ZF-5708: Zend_Http_Client does not have method to clean headers


Currently, there's no method that would reset the state of Zend_Http_Client , particularly that would clean all headers. While one can set and clean specific headers with setHeaders() and reset some state parts with resetParams(), full reset is impossible. This makes it very hard to reuse same client with same settings for multiple requests, and since many classes in Zend_Service_* still do so, it leads to various bugs.

We need to add either cleanup method or make resetParams() clean all headers, or have setHeaders somehow extended to clean all headers except for those set.


This other method should probably clear last_request and last_response as well, or what are you after? Would you also clear the entire "configuration" (e.g. uri, method, proxy, ...)?

I could do a patch if you gave me some feedback.

Fixed - now resetParameters(true) will reset headers and last_*