Hi am trying to pass data through ajax and getting Bad request error any help please
$scope.getSubCategory = function(id)
{
var category_id=id;
var data = {"CategoryId":"2"};
$.ajax({
url: "http://cashobby.abhigna.info/Services/CashobbyService.svc/subCategory",
type: "POST",
crossDomain : true,
dataType: "json",
data:data,
success: function (data) {
console.log(data);
},
//if wrong otp shoe user a error message
error: function (error) {
console.log(error);
// alert(request.responseText);
}
});
}
any help please I have tried to pass data '{"CategoryId":"2"}';
and through JSON.strinify
but no help any suggestion