I'm having an issue with the code in my app. It seems that the content-type is not being sent. Is there a way to force it to be sent?
$.ajax({
crossDomain: true,
type: 'GET',
url: 'http://serv/services/rest/contact/' + localStorage.getItem('contact'),
callback: 'jsonpCallback',
jsonpCallback: 'jsonpCallback',
jsonp: '_jsonp',
**contentType: 'application/json',**
dataType: 'jsonp json',
timeout : 10000,
success: function(data){
$("#name").attr("value", data.response.label);
} },
error: function (xhr, ajaxOptions, thrownError){
alert("Status: " + xhr.status + ", Ajax option: " + ajaxOptions + ", Thrown error: " + thrownError);
},
});
This is what my request header looks like:
Accept:*/*
Accept-Charset:ISO-8859-2,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
Cookie:JSESSIONID=F0ED33279488888888B35A731B40EE0C; oam.Flash.RENDERMAP.TOKEN=789456321
Host:serv
User-Agent:Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.83 Safari/537.1
It's clear that the contentType is missing. Any ideas on what could be causing this?
Thank you for your assistance.