I know there exists a question The right JSON content type? but I am confused when should one use which content type.
Hence the question : What are the differences between the various JSON content types and when should one prefer using which one ?
According to answers on similar questions on stackoverflow , application/json is the correct JSON content type but I was thinking then why are the JSON content types still used , what is the reason for that?
@Rndm, I'm glad you raised the issue again. It caused me to review and reaffirm it for myself. Thank you.
Not to beat a dead horse, again. But there seems to be precious little consensus on the net about what should be used as the JSON MIME type.
The spec lists clearly only one MIME media type for JSON and it is "application/json" (see https://www.rfc-editor.org/rfc/rfc4627, section "6. IANA Considerations".
However, there seems to be many cases where browsers are expecting other types, and this is unfortunate (see "Having just had a long fight with IE8 myself with this I found that if you're loading the json into an iframe as text/plain", What problems may using the MIME type application/json cause?, Norgg Nov 27 at 16:20).