Interface Test
Meaning: The test tool / analog phones or web code to send a request to the server side, the server returns a result after receiving the request, given
Objective: Front usually only do a simple check format, so you can bypass the front end, to see if the code in question
All tests are based on the API interface http protocol
1: How do interface testing it?
- ---- interface document interface message configuration
(interface address, the name of the interface, the request, the return value
sample request, request parameters description Parameter Description Returns) - ---- test tool constructed using the interface and transmits and receives messages
(mainstream testing tools: jmeter, postman, loadrunner)
Two: the library installation requests
- Installation requests library
pip install requests
- How to test requests library has been successfully installed it?
Pycharm in import: import requests, without being given anything to prove successful installation
- commonly used ways:
requests.get() requests.post()
3: Use the library requests
1. Construction of a simple get request, the get request comprising: request header, URL, and IP address
which can learn more about the status codes http:
2.post request