Bug Report #4641

Request external PUT does not work (CURL)

Added by dexcell - over 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:10/31/2012
Priority:NormalDue date:
Assignee:Jeremy Bush% Done:


Target version:3.3.1
Resolution:fixed Points:1



Hi guys, i wonder if you have same problem.

Here is the request part

        'hello' => 'world',

I also tried example from : http://kohanaframework.org/3.2/guide/kohana/requests#external-requests

Receive part (the API):

echo $this->request->body();

But it does not show anything.

After some googling, i found out the problem is because we are using CURLOPT_PUT http://stackoverflow.com/questions/2081894/handling-put-delete-arguments-in-php

So, if we comment some part in Kohana_Request_Client_Curl like code below:

public function _set_curl_request_method(Request $request, array $options)
    switch ($request->method()) {
        case Request::POST:
            $options[CURLOPT_POST] = TRUE;
//          case Request::PUT:
//              $options[CURLOPT_PUT] = TRUE;
//              break;
            $options[CURLOPT_CUSTOMREQUEST] = $request->method();
    return $options;

It works.

Thank you

Associated revisions

Revision 5abef4f1
Added by Alex Mayhew about 2 years ago

Fixing #4641: Curl PUT request does not post request body

Revision 5a103a18
Added by Jeremy Bush about 2 years ago

Merge pull request #334 from acidtv/3.3/develop

Fixing #4641: Curl PUT request does not post request body


#1 Updated by Sergio Zia about 2 years ago

I encounter exactly the same bug !
Is it possible to increase this bug priority ?

#2 Updated by Scott Jungwirth about 2 years ago

Yes, I had the same issue, took a while to debug. Major problem for integrating with RESTful APIs.

#3 Updated by Jeremy Bush about 2 years ago

  • Category set to Core
  • Status changed from New to Closed
  • Assignee set to Jeremy Bush
  • Target version changed from v3.2.3 to 3.3.1
  • Resolution set to fixed

Also available in: Atom PDF