空手道在帖子上夸大二进制文件 [英] Karate inflates binary file on a post
问题描述
我正在尝试将大型(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
由于发生了Base64编码,Multipart会为二进制文件充气: enctype ='multipart/form-data'是什么意思?
因此,失败可能是其他问题.如果您仍然认为仍然存在错误,请按照以下步骤进行操作(如果忽略大文件,我会找到一个),我们将很高兴为您提供: https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/upload/upload-image.feature
I am trying to post a large (16MB) binary file as multipart but the test keeps failing. When debugging using Wireshark (see screenshot) I found out that the payload size as well as the Content-Length are more than 30MB. Any idea what is happening? Here is the code:
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
Multipart will inflate a binary file because of the Base64 encoding that happens: What does enctype='multipart/form-data' mean?
So maybe the failure is some other problem. If you still think there's a bug I'll be happy to take a look if you follow this process (and omit the large file, I'll find one): https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue
A pure binary POST looks like this (second scenario): https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/upload/upload-image.feature
这篇关于空手道在帖子上夸大二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!