I'm using request.js for http request in Node.js.
request({
method: 'POST',
uri: 'http://www.example.com/getData',
followAllRedirects: true,
followOriginalHttpMethod: true,
json: true,
form: {
id: 1,
msg: 'Test data',
},
}, (err, res, body) => {})
Let's say when I post { id: 1, msg: 'Test data' }
to http://www.example.com/getData
, proxy will redirect to http://us.example.com/getData
.
The codes above do redirect to http://us.example.com/getData
, but How can I set the redirection with post data?