The third party service I'm using is very particular. I'm trying to set the accepts header to
Accept: application/json
But jquery 1.4.4 won't send just that. It keeps sending a variation, i.e.:
Accept: */*, application/json
I've tried a few variations, i.e. the one below. How can I get it to send just 'Accept: application/json' in the accepts header?
jQuery.ajax({
url: "/rest/cms.country",
beforeSend: function (xhr) { xhr.setRequestHeader('Accept', 'application/json'); },
contentType: "application/json; charset=utf-8",
type: 'get',
success: function () {
console.log('success');
},
error: function (jqXHR, textStatus, errorThrown) {
console.log('error' + errorThrown);
}
});