I have a html form like this:
<form method="post" action="https://serviceURL/">
<input name="account" ng-value="form.account" type="hidden">
<input name="name" ng-value="form.name" type="text">
<button type="submit">Continue</button>
</form>
When I submit the form all goes perfect. But when I try to do the same post request inside an angular service I'm getting
cannot load https://serviceURL/ Response for preflight has invalid HTTP status code 504
my service function looks like this
service.callServer =function(){
var query = "https://serviceURL/";
$http.post(query,{account:123,name:'jhon'});
}
My question is: What is the difference betwen those types of request? does the html action post add some headers that the http.post doesn't?