Skip to content
This repository has been archived by the owner. It is now read-only.

Handle application/json & text/json #2

Closed
wants to merge 1 commit into from

Conversation

@benschwarz
Copy link
Contributor

@benschwarz 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?

…le, Flickr and Yahoo LOVE to send on JSON bodies.)
@mislav
Copy link
Owner

@mislav mislav commented Jun 10, 2011

Any concrete examples of the wrong mime type being served?

@benschwarz
Copy link
Contributor Author

@benschwarz 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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants