I am having an odd issue making a POST request to my express app.
I have tested the API using Postman however when I copy the request code from Postman either the AJAX or XHR the request fails and the express app returns an undefined express body.
The console on the site spits out the following:
Resource interpreted as Document but transferred with MIME type application/json
The request looks like this (AJAX):
var settings = {
"async": true,
"crossDomain": true,
"url": "https://thedomainhere.com/hello",
"method": "POST",
"headers": {
"content-type": "application/json",
"cache-control": "no-cache",
"postman-token": "0158785a-7ff5-f6a3-54ba-8dfc152976fc"
},
"data": {
"senderEmail": "hello@hello.com"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Why would this work on Postman and in the console using Curl, but not from a web document?