Bug Report #4722

Kohana's PUT request via HTTP Body (CURL)

Added by k03 n00b almost 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:03/21/2013
Priority:NormalDue date:
Assignee:-% Done:


Target version:3.3.1
Resolution:worksforme Points:1


I have two computers in local network with Windows XAMPP installed and Kohana 3.3.0 running.
My "server" is using custom port 81.

When I'm sending PUT request via plain CURL like this:

$handler = curl_init();
curl_setopt($handler, CURLOPT_POSTFIELDS, 'THE BODY');
curl_setopt($handler, CURLOPT_URL, 'http://localnetwork:81/test');
curl_setopt($handler, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($handler, CURLOPT_RETURNTRANSFER, TRUE);
echo curl_exec($handler);

Everything works and I'm getting "THE BODY" to the "server".

When I'm trying same with Kohana request:

$request = Request::factory('http://localnetwork:81/test')
->body(json_encode('THE BODY'))
->headers('Content-Type', 'application/json');
$response = $request->execute();
echo $response->body();

The "server" doesn't get "THE BODY" and $this->request->body(); stays empty.

More examples:


#1 Updated by k03 n00b almost 2 years ago

It seems that you're using CURLOPT_PUT in


In PHP manual there's a text:

TRUE to HTTP PUT a file.
The file to PUT must be set with CURLOPT_INFILE and CURLOPT_INFILESIZE.

So maybe problem is that I'm not sending any file?
Should this be changed to CURLOPT_CUSTOMREQUEST ?

#3 Updated by Jeremy Bush almost 2 years ago

  • Status changed from New to Closed
  • Priority changed from High to Normal
  • Target version changed from Unscheduled to 3.3.1
  • Resolution set to worksforme

Also available in: Atom PDF