Postman primary use (2)

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.
Insert picture description here

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 **
Insert picture description here
- Start line
Insert picture description here
- headers
Insert picture description here
- composition of body
Insert picture description here
http response

  • http response status line
    Insert picture description here
  • headers
    Insert picture description here
  • body
    Insert picture description here
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.
    Insert picture description here
  • After sending the request, we will see the response result. We
    Insert picture description here
    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.

Published 35 original articles · won 4 · views 3621

Guess you like

Origin blog.csdn.net/qq_29074261/article/details/105459559