javascript - nodejs request returning null body from server for a POST request -


i sending http post request node using request (https://github.com/mikeal/request), , getting null body. same request getting sent hurl.it returning correct response correct body. request getting sent same nodejs server same server returning correct body. infuriating working last week , no longer working in nodejs.

my server.js is:

var request = require('request');  request({         uri: 'insert url here; contains sensitive info',         method: 'post',         body: 'insert body here; contains sensitive info',         followredirect: true,         maxredirects: 10         }, function(error, response, body) {                 console.log('body in response is: ' + body);         }); 

anyone have idea how fix this?

thank you.

i resolved issue. server posting apparently expecting user agent in header wasn't sending, throwing null exception, , returning null. has since been fixed.

thank you.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -