ab -n 100 -c 100 -T "application/json" -H "Content-Type: application/json" -p /home/ygt/abtmp/post.txt http://ip:端口/service-authentication/register/bindRegisterUser
通过ab压力测试post请求入参格式,注意请求header格式:
命令参数解析:-T "application/json" -H "Content-Type: application/json" 设置请求header格式
-p /home/ygt/abtmp/post.txt 设置post请求入参,文件位置
post.txt 入参格式为json,json格式不需要转义
{"args":{"accountType":"1","birthday":"1","cellphone":"1","gender":"1","idNo":"11","idType":"01","name":"测试","nickName":"测试","openId":"","sysCode":"1010001"},"token":"69ed775af83cc758a8f1ee58fd04852d845270e4224eacc061639f0a60d296b957b39b1bda9b183ae72fefdbffea36d631c564642bd2472dcb771feb8dfc9943"}
如果觉得《ab压力测试post请求入参json格式处理》对你有帮助,请点赞、收藏,并留下你的观点哦!