我尝试用node.js解析一个请求,所以我构建了下一个:
app.get('/download', function(req, res){
var parseJson = JSON.parse(req);
var file = parseJson.fileName;
res.download(file); // Set disposition and send it.
});
我用Advanced Rest客户端发送了一个请求:
网址:http://localhost:5000/download
方法:GET
原始参数:fileIn