Handle application/json & text/json #2

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

benschwarz commented Jun 10, 2011

Google, Flickr and Yahoo seem to LOVE sending text/javascript rather than correctly setting the mime-type… I've commonly seen text/plain, which is even worse—but we can't deal with any situation.

Being that this library is a "it should just work when I make a request" affair, I feel that this patch is aligned to your thinking.

What do you think?

@benschwarz benschwarz Handle application/json & text/json (Which large providers - AKA Goog…
…le, Flickr and Yahoo LOVE to send on JSON bodies.)
ca96694
Owner

mislav commented Jun 10, 2011

Any concrete examples of the wrong mime type being served?

Contributor

benschwarz commented Jun 12, 2011

Flickr API

⚡ curl -I http://api.flickr.com/services/rest/\?method\=flickr.photos.search\&api_key\=f29bdbe227712a27472cae9259cf995b\&user_id\=36821533%40N00\&format\=json\&nojsoncallback\=1
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8

Google Social API

⚡ curl -I http://socialgraph.apis.google.com/lookup\?q\=germanforblack.com
HTTP/1.1 200 OK
Content-Type: text/javascript; charset=utf-8

Google Search API

⚡ curl -I http://ajax.googleapis.com:80/ajax/services/search/web\?q\=pizza
HTTP/1.1 200 OK
Content-Type: text/javascript; charset=utf-8

mislav closed this in bddd8f9 Jun 12, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment