javascript - POST JSON data with cURL -
i want post json data server. have constructed 1 javascript object that:
var formdata; formdata[0] = { value : accx.tostring(); }
now post function is:
function postdata(){ var accx = acc.x; }
acc.x
generated in function , call postdata()
function function. curl data post example got is:
curl -i -x put https://abcd.com/v1/feeds/5e5530142d3wecwecwec28265eabe/streams/acc_x -h "x-api-key: 2b9e2596eafwefwef6a7956e6f7a" -h "content-type: application/json" -d '{ "value": "40" }'
now want want send data -d '{ "acc_x": "0.2319393291" }'
continuously [generated data, not same value] not getting how that. please :)
another problem is, // in url seen comment. how address this? please suggest , help.
do error back? suggest change -i -v, in order verbose response give more information.
also curl command uses put , not post say; please clarify if question 1 or other?
finally, try remove quote marks numeric values, don't need them.
Comments
Post a Comment