2021-02-07 Interface test tool-Postman use detailed explanation

Interface testing tool-Postman use detailed explanation

1. Install postman

Official website download address: https://www.postman.com/downloads/

Choose the corresponding version to download, and install it directly after downloading.

image

2. Postman interface description

 

image

 

3. POSTMAN interface request method

  •  
GET请求:点击Params,输入参数及value,可输入多个,

image

Response example: display the request response status code, response time, and response file size

image

Response body example: There can be multiple response formats. I am here because the request is Baidu, so the response is in html format.
Under normal circumstances, if we customize the interface, it is the response body in json format. For commonly used restful interfaces, the basic All return messages in json format

image

  •  
  •  
2. POST请求POST请求一:表单提交

In the example below, the request method, request URL, and request parameters are set, but the request header is not set. The request header is automatically generated according to the form of the request parameter

There is an association between the Content-Type in the request header and the format of the request parameters, such as:

image

image

image

POST request 2: json submission
As shown in the figure below, when we select JSON (application/json), it will automatically set the headers to application/json for us

image

POST request three: xml submission

image

POST request four: binary file submission

image

Other request methods such as PUT and DELETE are roughly the same as GET and POST, so I won’t give an example one by one here.

4. Management use case-Collections

Collections collection: that is, multiple interface requests can be put together and managed, and a collection is created in the same project, which is convenient for searching and unified processing of interfaces.

image
image

The first step is to create Collections.
Click the icon with the + sign in the figure above, enter Name: "abc", Description: "Sample demo", and click the Create button to create a collection successfully. The
second step is to add a request to Collections

After preparing all the data requested by the interface on the right side and verifying it, click the save button.
image

You can see it here after you save it, and you can click here when you want to call it again later, which is convenient and quick

image

Collections management is refined, here we group different requests and add subfolders
image

image

 

 

Guess you like

Origin blog.csdn.net/qingfengxd1/article/details/113747745