`setJsonContent` should set header's Content-Type to application/json
If I use $response->setJsonContent(array("status" => "OK"));, the header is:
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:keep-alive
Content-Type:text/html; charset=UTF-8
Date:Tue, 10 Mar 2015 09:17:57 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:nginx/1.6.2
Transfer-Encoding:chunked
X-Powered-By:PHP/5.6.4
I think it should be set to application/json but not text/html.
Thanks
Phalcon does not set this header automatically, you can set it as follows:
$response->setContentType("application/json");
When you call method like 'setJsonContent' you'd expect it will also set the content type header field to "application/json" as well, by default.
(Y)
That's already implemented in Phalcon 2.1 https://github.com/phalcon/cphalcon/blob/2.1.x/phalcon/http/response.zep#L519
it still does not work in Version => 3.2.0a
@subdigger Looks like it's in for V4. https://github.com/phalcon/cphalcon/blob/master/phalcon/Http/Response.zep#L642
@subdigger Looks like it's in for V4. https://github.com/phalcon/cphalcon/blob/master/phalcon/Http/Response.zep#L642
or not

@subdigger The example in there is not using setJsonContent The note says you need to set it manual OR use the Response object with setJsonContent