I have a list called "Users" and I need to retrieve the item count using .ajax from that list. For example, where "FirstName" == "James".
This is my request:
$.ajax({
url: siteUrl + "/_vti_bin/ListData.svc/Users/$count?$filter=((FirstName eq 'James'))",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
console.log(data);
},
error: function (data) {
console.log(data);
}
});
This way I get an error "Unsupported Media Type".
What am I doing wrong?