I am having difficulty setting the content-type header of an external Kohana3.1+ request.
$r = Request::factory($this->api)
->method(Request::PUT)
->body($this->to_json())
->headers('content-type', 'application/json');
The request ends up being executed by curl. The CURLOPT_ settings for the request type (PUT) and the request body (the json) are set correctly, but the content type does not get set.
Am I going about this in the wrong way?
It was a bug. The question was answered here:
http://forum.kohanaframework.org/discussion/8378/set-content-type-for-external-put-requests
You can cherry pick a fix here:
http://dev.kohanaframework.org/issues/3830