新建一个 startupWithHeader.json,这次在request里面添加了headers属性
[ { "description": "这是一个带header的post请求", "request": { "uri": "/post/with/headers", "method": "post", "headers": { "content-type": "application/json" }, "json": { "name": "huhanshan", "age": "18" } }, "response": { "status": 200, "json": { "huhanshan": "success", "status": "1" } } } ]
在terminal控制台,键盘输入:ctrl+c
然后 启动mock服务: java -jar ./moco-runner-0.12.0-standalone.jar http -p 8888 -c startupWithHeader.json
去jmeter里面填数据:
查看结果: