使用jmeter发送json数据。方法有三种
原创,转载请注明出处
1.利用CSV Data set Config。
参考:
http://demi-panda.com/2013/01/08/how-to-use-a-csv-file-from-json-with-jmeter/
2.直接在HTTP请求sampler当中,把json字符串放在Post body。
3.可以直接放在parameters
其实2和3 都是等同的。
注意,发送json格式的http请求的时候,需要添加HTTP信息头管理器设置Content-Type=application/json
原创,转载请注明出处
1.利用CSV Data set Config。
参考:
http://demi-panda.com/2013/01/08/how-to-use-a-csv-file-from-json-with-jmeter/
2.直接在HTTP请求sampler当中,把json字符串放在Post body。

3.可以直接放在parameters

其实2和3 都是等同的。
注意,发送json格式的http请求的时候,需要添加HTTP信息头管理器设置Content-Type=application/json

2019/06/05更新
如果后台接收的json串乱码,需要按照上图种配置的一样配置参数的编码格式
原因是json字符串本身要转成utf-8,改变content encoding:utf-8