【发布时间】:2017-09-10 14:50:25
【问题描述】:
我在 Node.js 中使用 request.js 进行 http 请求。
request({
method: 'POST',
uri: 'http://www.example.com/getData',
followAllRedirects: true,
followOriginalHttpMethod: true,
json: true,
form: {
id: 1,
msg: 'Test data',
},
}, (err, res, body) => {})
假设当我将{ id: 1, msg: 'Test data' } 发布到http://www.example.com/getData 时,代理将重定向到http://us.example.com/getData。
上面的代码确实会重定向到http://us.example.com/getData,但是我怎样才能用帖子数据设置重定向?
【问题讨论】: