In order to allow data to be exchanged between the server and the browser, a number of means are usually adopted, for example when returning an existing dataset in the database using JSON .
There are these here:
- application / json
- text / x-json
It turns out that I do not use any of them to work with data output of type JSON , usually using
text/plain , which is for simple type returns.
What is the correct MIME Type for JSON ?
In general all of these will work, but the most semantic is
application/json as RFC . Using the correct one, it makes it easier for all consumers to work properly – assuming that it is following the RFC.
There are situations where it can present problems, so do not discard the others. Each has a problem with some browser or some other application:)