如何从邮递员回复中下载附件

时间:2018-06-22 08:52:40

标签: postman newman postman-collection-runner

我有一个API,该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

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

有人可以建议我如何通过脚本或纽曼做吗

1 个答案:

答案 0 :(得分:0)

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

  

...you should select “Send and download” which will let you save the response to your hard disk.

如果您要尝试通过脚本执行此操作,请使用a tutorial about writing to your local file system by running a local serverhow to use Newman to do something similar