Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.6.0

Bug #17460 Allow set custom content-type header for POST requests
Submitted: 2010-06-03 00:10 UTC
From: zyava Assigned: avb
Status: Closed Package: HTTP_Request2 (version 0.5.2)
PHP Version: 5.2.12 OS: Windows, Linux
Roadmaps: 0.6.0    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 8 - 2 = ?

 
 [2010-06-03 00:10 UTC] zyava (Dmitriy Zavalkin)
Description: ------------ Look on next line in the HTTP_Request2->getBody method: if ('application/x-www-form-urlencoded' == $this->headers['content-type']) { If I wish to set manual content-type header, for example: Content-Type: application/x-www-form-urlencoded; charset=utf-8 because of this line post body will not be generated and sent. I propose change this line to: if (strpos($this->headers['content-type'], 'application/x-www-form-urlencoded') !== false) {

Comments

 [2010-06-03 05:06 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Feedback
If you could whip up a bit of code showing what you want to do; the expected vs actual results... ie.. $request = new HTTP_Request2(); $request->setFoo(); $result = $request->send(); assert($result->didSomething()); ... then you'll probably find someone happy to implement this for you :)
 [2010-06-03 05:30 UTC] zyava (Dmitriy Zavalkin)
$request = new HTTP_Request2 ( $url, HTTP_Request2::METHOD_POST, array ( 'adapter' => new HTTP_Request2_Adapter_Curl(), 'ssl_verify_peer' => false, 'connect_timeout' => Config::CONNECTION_TIMEOUT ) ); ... $request->setHeader('Content-Type', ' application/x-www-form-urlencoded; charset=UTF-8'); ... $request->addPostParameter('token', $token); ... $result = $request->send(); Expected: POST body isn't empty. Actual result: POST body is and content length = 0.
 [2010-10-09 12:11 UTC] avb (Alexey Borzov)
-Status: Feedback +Status: Assigned -Assigned To: +Assigned To: avb -Roadmap Versions: +Roadmap Versions: 0.6.0
 [2011-02-14 19:40 UTC] avb (Alexey Borzov)
-Status: Assigned +Status: Closed -Type: Feature/Change Request +Type: Bug
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.