Is it possible to set the request header of the http content type for 'application / json' when sending the jquery ajax http request to Internet Explorer?
We are trying to use the WCF REST service, which interprets the content type from the request header when formatting the response. Right now, no matter what we put in the request header, it always returns data in XML format.
We tried using the jquery.iecors.js plugin, which extends the jQuery ajax call to use the XDomainRequest object, but it still ignores the content type that is set in our ajax jQuery call.
Here's what our ajax call looks like:
makeGETRequest: function (requestUrl) { return $.ajax({ type: "GET", url: requestUrl, contentType: 'application/json', dataType:'json', cache: false }); }
source share