接口测试 jmeter PUT 请求,添加了请求参数,运行后,请求参数传的空

张伟 · November 10, 2015 · Last by 夏至 replied at August 12, 2016 · 2247 hits

jmeter PUT 请求,在 Parameters 添加了请求参数如下:

s,
运行请求接口,后端返回参数错误,查看请求参数,发现 put data 为空,如下:

这个怎么解决,使用 get,post 方法请求接口 传参正常
@monkey

共收到 10 条回复 时间 点赞

上下文说明清楚,不要就这样文字的描述,谢谢

直接放请求里。

The PUT and PATCH method body must be provided as one of the following:

define the body as a file with empty Parameter name field; in which case the MIME Type is used as the Content-Type
define the body as parameter value(s) with no name
use the Post Body tab
If you define any parameters with a name in either the sampler or Http defaults then nothing is sent. PUT and PATCH require a Content-Type.

我记得应该放在 bodydata 里好像

#2 楼 @azdwa 试了下,如果要写在 parameters 里面的话 name 必须为空,否则全部无效。
建议直接写在 body data 里吧。

body 里直接写 类似 post 的格式

body 里面加上参数变量才行

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up