简介
在Jmeter调试接口时,有时不清楚后端服务接口的具体路径,可以使用Request URL和cookie来实现接口请求。以下内容以使用cookie鉴权的接口举例。
步骤
① 登录网站后获取具体的Request URL和cookie信息
通过浏览器获取到Request URL和cookie,如下图
②在配置元件中添加信息头处理器,设置cookie信息

③确认传参,有些Request URL不传其它参数时,Playload为空(后面设置http请求时会使用到)

④配置请求配置,Playload不为空时,需要传参过去,否则不传

⑤记录Apifox和Jmeter对传参配置的不同之处
Apifox:当参数配置在body(消息体)时,信息头管理器不需要配置content-type=application/json,选中json格式即可
Jmeter:当参数配置在body(消息体)时,信息头管理器需要配置content-type=application/json,不然参数不会传过去