失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 用ab进行POST GET压力测试 且定义header及json的内容

用ab进行POST GET压力测试 且定义header及json的内容

时间:2021-08-15 13:48:30

相关推荐

用ab进行POST GET压力测试 且定义header及json的内容

这个以前没作过,找了文档。搞定。

要求时间的单curl测试的方式如下:

time curl http://xxxxx/hq/restapi/isStart

curl用来用post请求,且有header及请求内容

time curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: d63xxx-xxxx-xxxxf450" -d '{"lsock":[{"akcolde":"600000","marketType":"BB"}]}' "http://xxxxxx/hq/restapi/ime"

用ab来作吧。

ab -n 100000 -c 500 http://xxx/hq/restapi/isdrt

ab -n 10000 -c 100 -p "post.txt" -T "application/json" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: d6xxs-sdf-sdf09d" "http://cnxxx81/hq/restapi/queryRealTime"

post.txt

{"lstStock":[{"sterode":"600000","madfpe":"SH"}]}

如果觉得《用ab进行POST GET压力测试 且定义header及json的内容》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。