I've never seen this error before and I've used REST API many times. I am in SharePoint Online so maybe it behaves differently.
Whenever I insert and item into a list using REST, I get the following error and I don't know why.
Here's a snippet of my code
$.ajax({
url: fullUrl,
method: "POST",
data: JSON.stringify({
'__metadata': { 'type': 'SP.Data.Historical_x0020_RegisterListItem' }, //SP.Data.Historical_x0020_RegisterListItem /rr/_api/web/lists/GetByTitle('Register')/ListItemEntityTypeFullName
'Register': that.register, //choice column
'RiskRegister': that.riskRegister, //choice column
'Reopen': this.formatDate(that.reopen), //date column
'RiskOrIssue': that.riskOrIssue, //date column
'Status': that.status, //choice column
'problemT': that.probTitle, //single line of text column
'ProblemStatement': that.problemStatement, //multi-line text
'TaskOwner': that.taskOwner, //single line of text
'Probability': that.probability, //single line of text
'Impact': that.impact //single line of text
}),
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
success: function(){
alert("Item Added!");
},
error: function(data){
console.log(data);
}
});
Any help with this would be greatly appreciated. Thank you!