繁体   English   中英

无法通过空手道框架上传 zip 文件

[英]Unable to upload zip file through karate framework

我正在尝试使用堆栈溢出参考通过空手道框架上传 zip 文件: put-requests-to-upload-a-file-in-form-data-using- karate and karate documents upload.feature

请在下面找到代码:

Given path 'upload'
And header Content-Type = 'application/zip'
And multipart file code = { read: 'file:tests/create/export.zip', filename:'export.zip', contentType: 'application/zip' }
When method POST
Then status 200

我们收到错误,因为httpStatusCode="500"><links/><message>No ZIP data entries were found to import.</message>

当您使用multipart file您不设置Content-Type ,它将默认为multipart/form-data 这很可能是您想要的 - 但如果没有有关您的服务器的详细信息,没有人能够分辨出来。

如果需要解决此问题,请与服务器端团队的某个人合作。 或编辑与卷曲命令的作品,也许我们可以计算出你在做什么错了你的问题。

还可以在 Stack Overflow 上搜索其他答案: https : //stackoverflow.com/search? q =% 5Bkarate%5D+ multipart

否则请按照以下流程操作: https : //github.com/intuit/karate/wiki/How-to-Submit-an-Issue

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM