当content-type为multipart/form-data时,通过POST请求发送参数 [英] Sending parameter with POST requests ,when content-type is multipart/form-data
问题描述
我是JMeter的新手.我正在尝试创建一个测试计划,其中一个请求是包含某些参数的POST请求,请求标头中的内容类型为Multipart/Form-data.
I am new to JMeter. I am trying to create a test plan ,one of the requests is a POST request containing some parameter, the content type in the request header is Multipart/Form-data.
我正在从fiddler复制标题/参数,因为HTTP代理记录器无法正常工作.
I am copying the headers/parameters from fiddler because the HTTP proxy recorder is not working.
请查看我当前设置的图像.我无法使用该图像获得所需的响应.
Please see the image for the current settings I have.I am not able to get the required response using it.
推荐答案
按照 HTTP请求采样器文档
对HTTP POST使用multipart/form-data
使用multipart/form-data或application/x-www-form-urlencoded发布请求
Use a multipart/form-data or application/x-www-form-urlencoded post request
所以您要做的就是:
- 在为POST使用多部分/表单数据"框中打钩
- 删除所有"Content-Disposition"行
关于代理记录器不起作用",我从未遇到过任何问题,因此可能是配置错误或类似问题.有人发现 JMeter Chrome扩展程序易于使用.
In regards to "proxy recorder not working", I have never experienced any problems with it so it might be misconfiguration or something like this. Some people find JMeter Chrome Extension easier to use.
这篇关于当content-type为multipart/form-data时,通过POST请求发送参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!