New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle application/json & text/json #2

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@benschwarz
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?

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

This comment has been minimized.

Owner

mislav commented Jun 10, 2011

Any concrete examples of the wrong mime type being served?

@benschwarz

This comment has been minimized.

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

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