I am performing a post to a backend server which is an openid authentication library. It works when I have a simple form with its action pointing to the server url.
However it fails when I use the $http.post method. I have compared the headers and changed the content-type to url-form encoded. This resolves part of the problem, but the redirection from the server still fails.
Any ideas on what are the differences between a regular form post and angular’s $http.post which is causing this behavour ?
Server redirection is not supposed to work back into front end because the ajax request will give you the http status code of it’s final page reached. So if the page you request by ajax is redirecting to another page, it will give you 200 status. You can read the w3c draft for this http://www.w3.org/TR/XMLHttpRequest/#infrastructure-for-the-send-method .