I'm writing an angular application, and i'm trying to connect to our API using the $http service.
$http.post('https://backend-test/***/v001/login', {'userName': 'admin', 'password': 'passtest'}, {headers: {'Accept': 'application/json', 'Content-Type': 'application/json'}}).then(function success(response) {
console.log(response);
});
However, i keep on getting this error:
XMLHttpRequest cannot load https://backend-test/***/v001/login. Response for preflight has invalid HTTP status code 403
Also it seems to send an OPTIONS request instead of a POST request:
Request Method:OPTIONS
The strange thing is that it is working correctly when i use this tool:
Any thoughts?
$http.post('https://backend-test/***/v001/login', {params : {'userName': 'admin', 'password': 'passtest'}}, {headers: {'Accept': 'application/json', 'Content-Type': 'application/json'}}).then(function success(response) { console.log(response); });- Pierre-Luc Bolducparamsis not for post requests - charlietfl