ZF-10645: Zend_Http_Client Content-Type Header for PUT Requests

Issue Type: Improvement Created: 2010-11-04T17:36:07.000+0000 Last Updated: 2010-11-08T10:23:55.000+0000 Status: Resolved Fix version(s): - 1.11.1 (30/Nov/10)

Reporter: Steve Rhoades (sedonami) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Http_Client

Related issues: Attachments:


Currently, trying to add content-type header for PUT requests is impossible as the conditional block starting at line: 1107 checks only for method of POST.

Since it is totally reasonable for a PUT request to also carry the Content-Type header I propose changing that line to include the PUT method as well.

SO change: // Set the Content-Type header if ($this->method == self::POST && (! isset($this->headers[strtolower(self::CONTENT_TYPE)]) && isset($this->enctype))) {

        $headers[] = self::CONTENT_TYPE . ': ' . $this->enctype;

To: // Set the Content-Type header if (($this->method == self::POST || $this->method == self::PUT) && (! isset($this->headers[strtolower(self::CONTENT_TYPE)]) && isset($this->enctype))) {

        $headers[] = self::CONTENT_TYPE . ': ' . $this->enctype;




Posted by Matthew Weier O'Phinney (matthew) on 2010-11-08T10:23:53.000+0000

Fixed in 1.11 release branch and trunk.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.