The method property can be used to set the HTTP method for pthe request. The method is one of either GET, POST, PUT, DELETE or HEAD.AngularJS will replace the JSON-CALLBACK string with the name of a callback function which AngularJS creates. I am trying to create a simple post request with a JSON object to a PHP script.See this post: How can I make angular.js post data as form data instead of a request payload? http( method: POST, url: url, data: xsrf, headers: Content-Type: application/x-www-form-urlencoded ). I was tried to use AngularJS http and coffeescript to send a cross domain post request.lgalfaso when I say I want "application/x-www-form-urlencoded" data (by telling angular the content type) it shouldnt be sending JSON at all! AngularJS passing data to http.get request. Angular JS POST request not sending JSON data.Getting 400 bad request error using POST while communicating to different domain. Angularjs error when sending requests post by dropzone. What this achieves is the ability to upload any number of files with any other type of data in one request. For this example well send up JSON data along with some files.First well create a simple custom file upload angular directive. Lets say your AngularJS app is posting a simple JSON object like: "foo": "bar" .check if a request is a JSON request. if so, decode the JSON. populate the Request::request object.
return a HTTP 400 Bad Request when something went wrong. I am trying to send the post request with json data to server. But seems angularJS http.post method does not set the data into body.How can I implement this please? Thanks. If the request send to same site, then it works. I have the following code in my angularjs. http(.