When I send a http.post request to my service, I start by sending an Option request as required by Cors.
However, I've noticed that the OPTIONS (pre-flight) request does not return any response.data, whereas the POST request does. This creates an issue because I need to access the response.data from the POST response...
Is there a way in Angular to disregard the OPTIONS response during a http.post call?
$http.post("http://api.worksiteclouddev.com/RestfulAPI/api/vw_PeopleListSiteAccess_Update/Get/", JSON.stringify(vm.content))
.then(function (response) {
//success
vm.person = {
"firstname": response.data.Firstname,
"surname": response.data.surname
};
console.log(response.data);
},
function (error) {
//failure
console.log("Something went wrong..." + error.status);
})
.finally(function () {
vm.ptsnumber = "";
});
Chrome responses: https://i.sstatic.net/g8R0P.png