是否支持针对apachebench的多部分POST? [英] support multipart POST for apachebench?

查看:101
本文介绍了是否支持针对apachebench的多部分POST?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用apachebench(ab)测试文件上传性能. 我已经阅读了手册,找不到实现我目标的方法.

I want to use apachebench (ab) to test file upload performance. I have read the manual and can't find a way to achieve my goal.

我的目标是尝试通过具有POST方法和multipart/form-data格式的HTTP请求上传文件.

My goal is try to upload a file by a HTTP Request with POST method and multipart/form-data format.

ab支持"-p POST-FILE",但是我只能找到以下格式:key = value& key2 = value2

The ab support "-p POST-FILE", but I only can find the format key=value&key2=value2

我要发送的帖子数据是

Content-Type:multipart/form-data; boundary = ---- WebKitFormBoundaryuUlX4554LPBjInc5

Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryuUlX4554LPBjInc5

------ WebKitFormBoundaryuUlX4554LPBjInc5 内容处置:表单数据; name =文件"; filename ="411c40d9.jpg" 内容类型:图片/jpeg

------WebKitFormBoundaryuUlX4554LPBjInc5 Content-Disposition: form-data; name="file"; filename="411c40d9.jpg" Content-Type: image/jpeg

XXXXXXXXXXXXXXX(图像数据) YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

XXXXXXXXXXXXXXX (IMAGE DATA) YYYYYYYYYYYYYYYYYYYYYYYYYYYYY

我搜索了一段时间,找不到任何相关文章或方法来实现. 我使用cURL,它可以正常工作,但是我想进行压力测试. 因此,我需要使用ab来实现该目标.

I googled for a while and can't find any related article or way to achieve that. I use cURL and it works fine, but I want to do stress testing. So I need use ab to achieve that goal.

有什么建议吗?

推荐答案

这可能已经很晚了,但可能会对其他搜索相同内容的人有所帮助...

This may be very late but might help others who were searching for the same thing...

$ ab -c 5 -n 5 -v 4 -p example_post.txt -T "multipart/form-data; boundary=miuxupsktcqtriloonfbdudrgtawascl" http://yourapplication.local/upload/

贷方这个人.

这篇关于是否支持针对apachebench的多部分POST?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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