jsoncontenttype

What should be set for contentType if json object is sent in response


I am making an ajax call , here I am not sending any data I am fetching the data in response whcih was already set by previous request. On the server side I am building jsonObject and sending , what is the contentType I should use application/x-json or text/x-json as all my datas are text.


Solution

  • This should be easy to search for you, but anyway: What is the correct JSON content type?

    (TL;DR: The MIME media type for JSON text is application/json)