[share] tips for using apipost

Time:2020-10-29

preface

With the development of web technology, especially the separation of the front and back-end architecture primary key has become the mainstream. When debugging, we back-end programmers no longer rely on the page to operate, but directly debug the interface. For the get interface without permission control, this is a very easy work, but for the rest interface with permission or using other methods (post, put, delete, etc.), things are not so good. Fortunately, the API post artifact can help us solve these problems. I won’t talk about the basic use. There are a lot of online tutorials. Here we mainly mention some relatively advanced usages.

Configure environment settings

This is actually a relatively basic function. Since it is related to subsequent operations, it is also mentioned.

Now we have developed three sets of test environments, namely development, testing, pre release (or online environment). It happens that apipost has an environment setting. We can directly configure these three sets of environments in the environment settings, and directly select the corresponding environment when using it. In this example, it is very intuitive. We can configure the corresponding three sets of environments, as shown in the figure below
[share] tips for using apipost
[share] tips for using apipost
After setting up the three environments, the following figure is shown:
[share] tips for using apipost

Start calling environment

Select the environment, here is the test environment, and then we call the set environment variable, as shown in the figure:
[share] tips for using apipost
Here, to call the URL of the test environment, we just need to define the variable name of the URL in the environment, and then enter the URL address of the test environment. We can call it directly with {{variable name}}