空手道在岗位上膨胀二进制文件

时间:2018-09-20 12:10:43

标签: file-upload karate

我正在尝试将大型(16MB)二进制文件作为多部分发布,但是测试始终失败。使用Wireshark调试时(请参见屏幕截图),我发现有效负载大小以及Content-Length都超过30MB。知道发生了什么吗?这是代码:

Given path 'post/large/file'

And multipart file 16MB_file = { read: 'file:target/myBinaryFile', filename: 'myBinaryFileName', contentType: 'application/octet-stream' }
And header Authorization = 'Basic blablabla'
When method post
Then status 200

Wireshark screenshot

1 个答案:

答案 0 :(得分:0)

由于发生了Base64编码,因此Multipart将为二进制文件充气:What does enctype='multipart/form-data' mean?

因此,失败可能是其他问题。如果您仍然认为仍有错误,请按照以下步骤进行操作(如果忽略大文件,我会找到一个),我们将很高兴为您准备:https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

纯二进制POST如下所示(第二种情况):https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/upload/upload-image.feature