如何从 Postman Response 下载附件

Arc*_*yal 2 postman newman postman-collection-runner

我有一个 API,它发送具有以下标头的响应:

Headers(8)
Test Results(1/1)
Status:200 OK
Time:5890 ms
Size:1.24 MB
Access-Control-Allow-Origin ?*
Cache-Control ?no-cache
Content-Disposition ?attachment; filename=Report.csv
Content-Length ?1298149
Content-Type ?text/csv
Date ?Fri, 22 Jun 2018 08:50:05 GMT
Expires ?-1
Pragma ?no-cache
Run Code Online (Sandbox Code Playgroud)

我想下载附件文件'Report.Csv'

谁能建议我如何通过脚本或纽曼做到这一点

J.L*_*Lin 5

如果您从 Postman 应用程序中发送请求,您可以“发送和下载”响应。

...您应该选择“发送并下载”,这样您就可以将响应保存到硬盘上。

如果您想通过脚本来完成,这里有一个关于通过运行本地服务器写入本地文件系统的教程,或者如何使用 Newman 来做类似的事情