this question has answer here:
- post data in json format 4 answers
{ "address":"j.p.nagar", "payment_type": "paymentmethod", "time":"2015-09-12 03:22:31", "name":"madhava raju", "tel":"9591865409", "userid":"66", "deviceid":"66", "type":"cod", "seats_number":"1", "table_id":"2", "products[0]":{ "id":"1397529704", "sl":1,"topping":[{"1397879078":"1441207278"}], "instruction":"poora" } }
how can send above data server using angular ajax post method , url parameters.
the following sends post request:
$http.post(url, data, options).then(onsuccess, onerror);
url
beigin remote server url, can put parameters here,?address=j.p.nagar&payment_type=paymentmethod
, etc...data
being object wish send via post, assume want post object specified in post, put here.options
optional, can leave out if want. can used timeout , similar.onsuccess
,onerror
callbacks (functions) handle reponse server.
Comments
Post a Comment