Postman send request principle
The working principle of postman: distinguish the front end from the back end, use postman to send a request to the server, after the server responds, then pass the response data to postman, the entire process is independent of the front end.
Basic knowledge of HTTP requests
- http request is a way for server and client to exchange data
- There are two types of messages:
- Request: You client launches to trigger a server action
- Response: reply from the server
** Composition of http request **
- Start line
- headers
- composition of body
http response
- http response status line
- headers
- body
Send a request using postma
- First get the request address
- Take the https://so.csdn.net/so/search/s.do?q=openc interface as an example
- First click the plus sign to create a request
- Then select the request method, the get request used here
- Fill the requested address into the text box
- Add the requested parameters into [You can also copy directly to the text box, the parameters will be added automatically]
- The path of the text box? The following is the parameter, the key is before the equal sign, the value is after the equal sign, and then click send to send the request, and finally we can hold the request. When holding, we will ask us to create a collection, the name of the collection is based on what you want to test The module can be named.
- After sending the request, we will see the response result. We
mainly check the content in the red box to see if the request is successful, and the time taken by the request, whether the data returned by the request is correct, and so on.
postman sends post request
Only need to pay attention to two points, when sending a post request, the first need to select the post request, the second time when sending the parameters can not be written in the parameter, need to be written in the body.