angularjs json to application/x-www-form-urlencoded
When posting form data that is URL encoded, transform the request with the httpParamSerializer service: http( headers: Content-Type: application/x-www-form-urlencoded charsetUTF-8, url: https://fnrc.gov.ae/roayaservices/api/getHPData, method: POST, transformRequest And HEADERS: Content-Type:"application/x-www-form-urlencoded" When I edit request to look like this second example, request passes and email is sent. So question is, is it possible to post Form Data instead of JSON with http.post? Hello, Im trying to implement a method which will have contentType: application/x-www-form-urlencoded which will be expecting json string as an input. Example and description of http.post method request in AngularJS, complete code snippet with description.
to serialize data from JSON var data .param( fName: scope.firstName, lName: scope.lastName ) var config headers : Content-Type: application/x-www-form-urlencoded AngularJS - HTML enhanced for web apps!I have to work with a backend (PHP) which does not automatically parse JSON, and which I cannot change. I would like angular to automatically urlencode my POST data when the Content-Type is application/x-www-form-urlencoded. angularjs forms post ngresource | this question asked Dec 9 14 at 9:41 Raphi 103 1 10 3 Possible duplicate of how to send x-www-form-urlencodedBy default Angular uses application/json and its not enough to set the header to form url encode, you have to actually transform the data, you can do Отправить данные методом POST с AngularJS в Yii и получить результаты валидации с Yii в JSON. HTML.echo CJSON::encode(data) Yii::app()->end() Tags: ajax json angularjs http.http.defaults.