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

Bug #18421 Body not sent for PUT request with Curl Adapter
Submitted: 2011-04-03 07:34 UTC
From: sicromoft Assigned: avb
Status: Closed Package: HTTP_Request2 (version 2.0.0beta2)
PHP Version: 5.3.5 OS: ubuntu 10.10
Roadmaps: (Not assigned)    
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:
Solve the problem : 49 - 44 = ?

 [2011-04-03 07:34 UTC] sicromoft (Russell Davis)
Description: ------------ When making a PUT request using the Curl Adapter, the body of the request does not get sent. The problem appears to be that the curl library is not calling the callback set for CURLOPT_READFUNCTION. The problem goes away when setting the 'follow_redirects' config to true, since that causes the body to be written directly without using the callback. Test script: --------------- $request = new HTTP_Request2('localhost', 'PUT', 'adapter' => 'HTTP_Request2_Adapter_Curl'); $request->setHeader('content-type', 'application/x-www-form-urlencoded'); $request->setBody('foo=bar'); $request->send(); Expected result: ---------------- "foo=bar" gets sent as the body Actual result: -------------- no body is sent


 [2011-04-03 21:49 UTC] avb (Alexey Borzov)
-Status: Open +Status: Closed -Assigned To: +Assigned To: avb
Curl Adapter now sets CURLOPT_UPLOAD on PUT requests and callback is then properly called. This is in release 2.0.0beta3