I am trying to update a list item using rest api
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + url,
type: "PATCH",
headers: {
"accept": "application/json;odata=verbose",
"__metadata": {"type": "SP.Data.CaseListItem"},
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"content-Type": "application/json;odata=verbose",
"X-Http-Method": "PATCH",
"If-Match": olditem.__metadata.etag
},
data: JSON.stringify(item),
success: function (data) {
console.log(data);
},
error: function (error) {
console.log(JSON.stringify(error));
}
});
It throws the below error
{"readyState":4,"responseText":"{\"error\":{\"code\":\"-1, Microsoft.SharePoint.Client.InvalidClientQueryException\",\"message\":{\"lang\":\"en-US\",\"value\":\"A type named 'SP.Data.ClientsListItem' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.\"}}}","responseJSON":{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"A type named 'SP.Data.ClientsListItem' could not be resolved by the model. When a model is available, each type name must resolve to a valid type."}}},"status":400,"statusText":"Bad Request"}
I have passed the modelname in metadata of header. What should I change?