API Requests return text/html when they should return application/json
Documentation:
http://en.wikipedia.org/wiki/JSON
The MIME type for JSON text is "application/json"
Here's an example call to your application.
$ curl -i "http://mode.mofuse.com/api/ver1/?u=Mozilla/5.0
(iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us)
AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341
Safari/528.16"
HTTP/1.1 200 OK
Date: Wed, 03 Aug 2011 16:59:14 GMT
Server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.12 with
Suhosin-Patch
X-Powered-By: PHP/5.2.4-2ubuntu5.12
Content-Length: 369
Connection: close
Content-Type: text/html
{"device":{"type":"desktop","brand":"generic web
browser","model":"","os":"","os_version":""},"display":{"width":800,"height":600,"max_image_width":600,"dual_orientation":false},"video":{"mp4":false,"mov":false,"wmv":false,"flv":null,"3gp":null},"function":{"click_to_call":"tel:","click_to_sms":"none"},"javascript":true,"api":{"version":"1.0","total_time":"0.0233s"}}
Notice yours is:
Content-Type: text/html
It should be:
Content-Type: application/json
Browsers interpret it differently. Pretty cut and dry and a small change in my opinion.
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Aaron Ball on 03 Aug, 2011 09:45 PM
Yes, this does sound like a quick and correct change. I have added the above request as well as your request for jsonp to our feature/bug tracking system. These should be updated soon.
Aaron Ball closed this discussion on 03 Aug, 2011 09:45 PM.