如何使用请求模块检查来自http post请求的响应是json格式还是流?
request({
uri: proxy_url,
method: req.route.method,
body: req.params.file
}, (err, resp, body) => {
if (err)
console.log(err)
if (body == Stream)
//write to file
else {
console.log(body)
}
})