call = "https://[email protected]/2010-04-01/Accounts/sasa/Calls.xml"
fields = { To : "+12321434", From : req.body.from }
request.post
url: call, body: fields (err,response,body) ->
console.log response.body
How can I pass fields to the HTTP POST request?
It works if I pass a string like "To=+12321434" but not "To=+12321434,From = req.body.from"
You need to stringify your data, look at the example: http://nodejs.org/docs/latest/api/querystring.html#querystring.stringify
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With