我正在使用请求js下载文件。
function requ(){
const options = {
uri: `api/tasks/${id}/attachments/${attachmentId}`
}
return rp.get(options)
}
我的问题是:
为什么用管道传递给像requ()。pipe(res)这样的“ res”起作用,并使用“ send”之类返回上述请求的结果
requ().then((result)=>{
//here result is the file's representing string
res.send(result)
})
不是吗?