The following code triggers a GET instead of a POST HTTP request.
function AddToDatabase() { this.url = \'./api/add\'; } AddToDatabase.prototype.postData
I had the same problem and found this question but answers didn't solve my problem. I eventually solve it by removing contentType field in ajax request.
contentType
contentType: "application/json",