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

Bug #1333 HTTP_Request always sets Content-Type on requests
Submitted: 2004-05-03 19:45 UTC
From: cardoe at cardoe dot com Assigned: avb
Status: Closed Package: HTTP_Request
PHP Version: Irrelevant OS: Linux
Roadmaps: (Not assigned)    
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 : 27 + 29 = ?

 
 [2004-05-03 19:45 UTC] cardoe at cardoe dot com
Description: ------------ HTTP_Request (version 1.2 & 1.2.1) always set Content-Type: application/x-www-form-urlencoded even on GET requests (this is the incorrect behavior. As a follow up, if you do a POST request and reuse the same object to make a GET request, it will put the POST data in the content body. Also an incorrect behavior, it shouldn't put anything. Currently I'm using a ->clearPostData() method call, which is depreciated. Reproduce code: --------------- <? $req->setURL("http://www.google.com"); $req->setMethod(HTTP_REQUEST_METHOD_GET); $req->sendRequest(); //view this with Ethereal //Content-Type is on $req->setURL("http://www.google.com"); $req->setMethod(HTTP_REQUEST_METHOD_POST); $req->addPostData("myVar", "1"); $req->sendRequest(); $req->setURL("http://www.google.com"); $req->setMethod(HTTP_REQUEST_METHOD_GET); $req->sendRequest(); //view this with Ethereal //my var will be sent like POST data and Content-Type is on. Expected result: ---------------- no Content-Type for any GET & no previous POST data sent with GET.

Comments

 [2004-05-08 19:14 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-05-19 10:58 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!