空手道在帖子上夸大二进制文件 [英] Karate inflates binary file on a post

查看:65
本文介绍了空手道在帖子上夸大二进制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将大型(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屏幕截图

解决方案

由于发生了Base64编码,Multipart会为二进制文件充气: enctype ='multipart/form-data'是什么意思?

因此,失败可能是其他问题.如果您仍然认为仍然存在错误,请按照以下步骤进行操作(如果忽略大文件,我会找到一个),我们将很高兴为您提供:Wireshark screenshot

解决方案

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屋!

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