如何使用node.js(express.js)重新发送带有上传文件的post multipart / form-data表单到不同的服务器?

我发表了一个表单(enctype =“multipart / form-data”)到node.js(express.js框架),只是想发送这个相同的post请求,就像它只是不同的服务器。 什么是最好的方法在node.js?

删除express.bodyParser并尝试像这样的pipe道:

req.pipe(request('http://host/url/')).pipe(res) 

你可以用Mikeal的Node.js请求( https://github.com/mikeal/request )来尝试。 这将是这样的:

 app.post('/postproxy', function(req, res, body){ req.pipe(request.post('http://www.otherserver.com/posthandler',body)).pipe(res); });