Interface 3: Adding student information
Brief description: Practice passing JSON type parameters
Request URL:http://api.nnzhp.cn/api/user/add_stu
Request Method: Post
1. Open JMeter, right click on test Plan, select Add-threads-thread Group
2, click on Thread Group, right-add sampler-http request
3,http Request page, server name or IP field input: api.nnzhp.cn; method select Post; path input:/api/user/add_stu
Click Body Data to enter the JSON parameter
{
"Name": "Aodi",
"Grade": "Tianxie",
"Phone": "18811111188",
"Addr": "Beijingcaoyang"
}
4, click on Thread Group, right-add listener-View results tree, click the toolbar green small arrow to execute the script
5, click View Results tree, view request URL and response data
POST Http://api.nnzhp.cn/api/user/add_stu
POST Data:
{
"Name": "Aodi",
"Grade": "Tianxie",
"Phone": "18811111188",
"Addr": "Beijingcaoyang"
}
{
"Error_code": 1000,
"MSG": "Add Success"
}
20171213-python Automation-Interface test-jmeter-post-add-stu