无法通过空手道框架上传zip文件 [英] Unable to upload zip file through karate framework

查看:82
本文介绍了无法通过空手道框架上传zip文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用堆栈溢出参考通过空手道框架上传zip文件:

I am trying to upload a zip file through karate framework using the stack overflow reference: 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>

推荐答案

使用 ,您没有设置Content-Type,它将默认设置为multipart/form-data.最可能是您想要的-但没有人会告诉您有关服务器的详细信息.

When you use multipart file you don't set the Content-Type, and it will default to multipart/form-data. Which is most likely what you want - but no one will be able to tell without details about your server.

如果需要解决此问题,请与您的服务器端团队中的某人一起工作.或者使用起作用的cURL命令编辑您的问题,也许我们可以弄清楚您在做什么错.

Work with someone from your server-side team if needed to resolve this. Or edit your question with a cURL command that works and maybe we can figure out what you are doing wrong.

这篇关于无法通过空手道框架上传zip文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆