我是空手道新手,所以我需要你的帮助。我有.feature文件。我们有应用程序接口,它应该返回提交数据的.zip文件
Given path EndpointUrl + 'request-commit/{param1}/{param2}'
When method GET
Then status 200
And def responsebytes = responsebytes
总体而言,脚本运行良好,因为在Content-disposition中我确实看到了附件".zip“文件
以防我使用
curl -k link --request GET -H 'content-type: application/json' -H 'client_id: 12344' -H 'accept: application/json' -O -J
我可以从remote_host下载.zip文件
但是如何在脚本执行后将zip压缩到本地目录中呢?如何在空手道中使用来自curl call的正确标志-O和-J?你能帮我解决这个问题吗?
谢谢!
发布于 2020-11-13 14:15:04
这应该会将文件保存到target/foo.zip
:https://stackoverflow.com/a/54593057/143475
* karate.write(responseBytes, 'foo.zip')
你可能会发现这很有趣:https://stackoverflow.com/a/64352676/143475
https://stackoverflow.com/questions/64820249
复制