Before reading this article, you need to understand a few simple workspaces of Postman. If you haven’t mastered it yet, you can check my article for a
simple understanding of the Postman interface operation.
After mastering it, we can officially start our interface test.
We first select Collections,
click the plus sign above to pull out one more item,
then we select the item we just clicked with the plus sign, click the pen next to the name to change the name, enter the name
we want to name, and then click the position outside the input box It can be saved
, and then we right-click on the project and select Add request to create a request,
so that one of our request bodies comes out.
Here is a request logic created by myself with springboot. Splicing and putting the content back
here, you can also find a way to get an interface out
Then we go back to Postman, click on the request we just created, and then click on this pen to change the name.
After the input is complete, click on a position other than the input box or press Enter. Then select
the request method here. I choose get
and enter this position. Take a look at the requested address.
There are often parameters following the path question mark. For example, path?kye="222"
You only need to put the entire path up, and it will automatically remove the key-value pairs after the question mark for you.
Let’s take a brief look. Most of the time, Params on this interface
is where the get request parameters are placed.
Authorization is used to make sound
Headers. It represents the content of the request header.
Body is the method of parameter transmission used in post requests most of the time
.
Tests is the script after the request.
Settings is some settings
. The body has many parameter forms. The default
none means nothing . The following is the x-www-form-urlencoded that can transfer files in the form-data form. It can only be a key-value pair. If it is raw, you can pass many parameters, especially our json form. You can choose the type binary here to convert the file in binary mode. Passing parameters is often useful
In fact, I don’t think it’s useful for the last one.
There’s also a cookie here, which is mainly to manage our cookie information.
Then here we click Send to send the request,
and the result of the request will appear below.