I am trying to send some JSON data to the server but I keep getting a 415 error: Unsupported Media Type
. This is my ajax call
$.ajax({
type: "POST",
url: 'http://mywebsite.com?'+"token="+token+"&account="+account+"&version=1.0&method=put",
dataType: 'jsonp',
contentType: "text/json",
processData: false,data: JSON.stringify(jsonData),
success: function () {
alert("Thanks!");
}
})
}
I noticed that in the request header there is no content-type
listed. So how do I set the content type for the request header?
Thanks!