These are chat archives for request/request

1st
Feb 2015
Gergo Szonyi
@szexigexi
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
@szexigexi
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
simo
@simov
Feb 01 2015 20:36
@szexigexi you can use
request({url: 'url', method: 'POST', form: {foo: 'bar'}}, function(err, res, body) { ... })