41
Is there any performance advantage of using content type application/json sending an object serialized to json over text/plain?
I know many frameworks (like Spring) can map and serialize data based on the content type, but in general I find that this process is easy enough that it isn't a compelling reason to use application/json over text/plain for JSON objects.
Example:
xhr.setRequestHeader("Content-type","text/plain");
// or
xhr.setRequestHeader("Content-type","application/json");
xhr.send(JSON.stringify({"foo": "bar"}));