I am sending the below ajax request to server which is running in local host. Before sending request i tested the request using REST CLIENT in Firefox iam getting the response and the status also 200. But when i make the request from jquery iam getting error. I tired to figure out the error using firebug iam getting bad request. Am i missing anything?
$.ajax({
type: "POST",
url: "http://10.8.2.18:8080/myservice/services/listObject",
data: { "userAgent":null,
"name":"xxx",
"delimiter":"/",
"marker":null,
"prefix":"localmedia/my_datas/"
},
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
alert('Success');
var json = $.parseJSON(data);
alert(json);
},
error: function (data, status, error) {
console.log(data);
console.log(status);
console.log(error);
alert("error");
}
});
});