【发布时间】:2020-03-04 10:30:11
【问题描述】:
我想在 JMeter 中发送如下请求负载:
------WebKitFormBoundaryeBikRH0JCrgmtTvt
Content-Disposition: form-data; name="name"
test
------WebKitFormBoundaryeBikRH0JCrgmtTvt
Content-Disposition: form-data; name="description"
testing
------WebKitFormBoundaryeBikRH0JCrgmtTvt
Content-Disposition: form-data; name="configFile"; filename="my-project-1513669048551-73373e5a6b29.json"
Content-Type: application/json
------WebKitFormBoundaryeBikRH0JCrgmtTvt--
所以我尝试在“参数”选项卡中添加名称和描述部分,并将表单数据作为内容类型,并在 HTTP 请求采样器的“文件上传”选项卡中添加文件。
这是执行后我在请求正文中得到的:
POST data:
--t9u984dDyYVtn6R0e8-OiZQyWRv9gk1
Content-Disposition: form-data; name="name"
Content-Type: form-data; charset=US-ASCII
Content-Transfer-Encoding: 8bit
test
--t9u984dDyYVtn6R0e8-OiZQyWRv9gk1
Content-Disposition: form-data; name="description"
Content-Type: form-data; charset=US-ASCII
Content-Transfer-Encoding: 8bit
testing
--t9u984dDyYVtn6R0e8-OiZQyWRv9gk1
Content-Disposition: form-data; name="configFile"; filename="my-project-1513669048551-73373e5a6b29.json"
Content-Type: application/json
Content-Transfer-Encoding: binary
<actual file content, not shown here>
--t9u984dDyYVtn6R0e8-OiZQyWRv9gk1--
我想从请求名称和描述部分中删除这部分
Content-Type: form-data; charset=US-ASCII
Content-Transfer-Encoding: 8bit
这会导致失败,状态码:415 需要这方面的帮助
【问题讨论】:
标签: jmeter jmeter-5.0