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

Modify content-type for json response #748

Merged
merged 1 commit into from Aug 17, 2015

Conversation

Projects
None yet
2 participants
@ollie314
Contributor

ollie314 commented Aug 17, 2015

The MIME media type for JSON text is application/json. (Source: RFC 4627 - http://www.ietf.org/rfc/rfc4627.txt).
According to the rfc, the media type must be 'application/json' instead of 'text/json'. Standard browser (ie: webkit, geko), extensions and libraries automatically recognize application/json MIME media type.
Note : The default encoding is UTF-8. (as specified in the rfc). So no changes regarding the encoding is needed.
Note: I would mention that this isn't a mandatory but it is a rules from rfc.
Another point to underline. Sometimes, we have an issue on IE (don't know which version) with application/json. The MIME should be 'text/javascript'. A patch may be necessary for this case.

Modify content-type for json response
The MIME media type for JSON text is application/json. (Source: RFC 4627 - http://www.ietf.org/rfc/rfc4627.txt).
According to the rfc, the media type must be 'application/json' instead of 'text/json'. Standard browser (ie: webkit, geko), extensions and libraries automatically recognize application/json MIME media type.
Note : The default encoding is UTF-8. (as specified in the rfc). So no changes regarding the encoding is needed.
Note: I would mention that this isn't a mandatory but it is a rules from rfc.
Another point to underline. Sometimes, we have an issue on IE (don't know which version) with application/json. The MIME should be 'text/javascript'. A patch may be necessary for this case.

maskas added a commit that referenced this pull request Aug 17, 2015

Merge pull request #748 from ollie314/patch-1
Modify content-type for json response

@maskas maskas merged commit ef0feab into impresspages:develop Aug 17, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@maskas

This comment has been minimized.

Show comment
Hide comment
@maskas

maskas Aug 17, 2015

Member

+1

Member

maskas commented Aug 17, 2015

+1

maskas added a commit that referenced this pull request Dec 22, 2016

Merge pull request #748 from ollie314/patch-1
Modify content-type for json response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment