These are chat archives for request/request

Feb 2015
Gergo Szonyi
Feb 01 2015 19:13
hi @Yashko, i'm here for the same
i can't figure out how to pass data to a post request
i've tried: request({url: 'url', method: 'POST', json: true, body: {foo: 'bar'}}, function(err, res, body) { ... }) but is did not work
Gergo Szonyi
Feb 01 2015 19:24
okay, i figured out: request({url: 'url', method: 'POST', body: querystring.stringify({foo: 'bar'})}, function(err, res, body) { ... })
you need querystring = require('querystring') before it
Feb 01 2015 20:36
@szexigexi you can use
request({url: 'url', method: 'POST', form: {foo: 'bar'}}, function(err, res, body) { ... })