0 votes
in JSON by
What is the correct JSON content type?

I've been messing around with JSON for some time, just pushing it out as text and it hasn't hurt anybody (that I know of), but I'd like to start doing things properly.

I have seen so many purported "standards" for the JSON content type:

application/json

application/x-javascript

text/javascript

text/x-javascript

text/x-json

But which one is correct, or best? I gather that there are security and browser support issues varying between them.

1 Answer

0 votes
by
For JSON text:

application/json

The MIME media type for JSON text is application/json. The default encoding is UTF-8.

For JSONP (runnable JavaScript) with callback:

application/javascript

Related questions

0 votes
asked Feb 18, 2020 in Azure by rahuljain1
0 votes
asked Oct 3, 2023 in JSON by AdilsonLima
...