For a while, I sent the answer with JSON just like plain text: plain/text , however, I would like to finally send the right Content-Type header.

Here are some of the proposed "standards" for JSON MIME:

 application/json application/x-javascript text/javascript text/x-javascript text/x-json 

However, which one is correct or just the best regarding security / customer support (browsers, etc.)?

Translation of the question "What is the correct JSON content type?"

1 answer 1

For JSON :

According to the IANA and RFC 4627 registration: application/json in UTF-8 .

For JSONP :

application/javascript is also in UTF-8 .


When the creator of JSON Douglas Crawford was asked why not text/json , he replied that it was not a JS script, but not a text, therefore application/* rather than text/* .