I\'m trying to make a cross-origin POST request using Angular $http with the following code.
//I\'ve tried setting and removing these http config options
$http.d
My problem was that I was setting the data
variable to an object instead of a string.
return $http({
method: 'POST',
//withCredentials:true,
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
data: {'key1':'value1', 'key2':'value2'},
url: url
});
Once I changed it to data:'key1=value1&key2=value2'
it worked fine. There was also a backslash in there that I had to manually put in the %5c
code for.