Bug Report #4722
Kohana's PUT request via HTTP Body (CURL)
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);
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')
$response = $request->execute();
The "server" doesn't get "THE BODY" and $this->request->body(); stays empty.
#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 ?