性能测试Jmeter 性能测试五:Jmeter录制脚本时接口请求方法和传参的注意事项

接口使用POST方法--多个入参

请求的url:http://localhost:8080/delete/

Json串格式参数,示例:{"userid":1, "token": "868d26e05666c5aaeb76d361faa7448c", "articleId":[1,2,3]}

即如果入参的key value中value不是string,而是list,则在jmeter中可以写入如下:将变量参数写入[]中

接口使用PUT方法--多个入参

请求的url:http://localhost:8080/update/

Json串格式参数,示例:{"userid":3, "token": "a1c0738a6cf054606b055a419c3390f3", "articleId":11, "title":"python", "content":"test test"}

接口使用GET方法--单个入参

http://localhost:8080/getBlogContent/1

因为get方法可以直接将入参写入URL后面,所以在jemter中可以写入如下:

接口使用GET方法--多个入参

http://localhost:8080/getBlogsContent/articleIds=1,2,3

 

猜你喜欢

转载自blog.csdn.net/chang_jinling/article/details/94228657