1.测试不需要任何参数的接口地址:GET:http://api-test.com/test.php
- 测试命令:ab.exe –n 800 –c 200 http://api-test.com/test.php
2.测试需要带header参数的接口地址:GET:http://api-test/header.php
- 测试命令:ab.exe -n 800 -c 200 -H "Content-Type:application/json" -H "Authorization:Bearer LTB1fdhfdDFghr5567fghgfh5hfgb9BAaZB" http://api-test/header.php
3.测试post请求的接口地址:POST:http://api-test.com/post.php
- 测试命令:ab.exe –n 500 –c 100 –p post.txt –T application/json http://api-test.com/post.php
- 制作请求参数文件:post.txt,请求的数据格式为json
-
{ "grant_type": "password", "client_id": "test", "client_secret": "sdfsdfsdfDFD0573mksdfdDFEFlsdfsdf", "scope": "test", "username": "18814137313", "password": "123456" }