Set the content type to application/x-www-form-urlencoded. Angularjs simple form submit. By admin | February 23, 2018.
0 Comment.Though notice that there is a problem with any type of ajax/ http post/get in a jsFiddle so you will have to run it locally.method: "POST", headers: Content-Type: application/x-www-form- urlencodedfunction () var data (Usuario: "midana",Senha:"senha") var config headers : Content-Type: application/x-www-form-urlencodedcharsetutf-8, data: Device:"1" .If you run angular on localhost, you need allow the cors settings for http requests. I use CORS plugin for this job on firefox. http.post(scope.url, JSON.stringify("shouldnotfindanyresultsstring"), headers: Content-Type: application/x-www-form-urlencoded ).Post request return wrong status code. Response for preflight has invalid HTTP status code 405 AngularJS. URL-encoding variables using only AngularJS services.let headers new Headers( Content-Type: application/x-www-form- urlencoded) let options new RequestOptions( headers: headers, withCredentials: true ) this.