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

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)    
Subscription  


 [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

Comments

 [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