Here is my client side jQuery code:
$.ajaxSetup ({
contentType: "application/json",
datatype: 'json'
});
$.ajax({
type: "POST",
url: "http://localhost:1234/path",
data: JSON.stringify(myData),
success: function(aString){
alert(aString);
},
error: function(errorData){
alert(errorData);
}
});
Here is the data that the server sends:
200
Content-Type: application/json
"aStringsData"
The warning displays quotation marks "aStringData". However, I expect the quotes to be selected due to the automatic JSON.parse that I expect from the data type: "json". Am I wrong about this?
hansi source
share