I have seen return type json , application/json while working with ajax. I have tried both and found the same result. Please anyone let me know the difference between these two.
datatype argument on the
$.ajax method accepts either the name of a format (like
xml) which jQuery knows how to parse, or a MIME type (which is
application/json), which jQuery can map back to a parseable type. In this case, jQuery is mapping
json for you, because it's a common format.
datatype argument is not what MIME type you expect from the server, but how jquery should parse the response.
The documentation for
dataType (default: Intelligent Guess (xml, json, script, or html))
The type of data that you're expecting back from the server.