Article directory
首先安装好apifox软件,附上官方下载地址[官网](https://www.apifox.cn/)。
1. Interface import
First you need to create your own project.
Enter your own project, click the "Import Data" button, click the "New Data Source" button
to configure the data source parameters (the prerequisite is an accessible data source URL), you can create a new module in the interface part, try not to put all the interfaces Under the root directory.
Once completed, click Import Now. If the service is normal, you can import the interface in the project. Take a screenshot of the interface sample I imported earlier.
2. Configure global token
The Token method is to put the login credentials in the interface request parameters (usually placed in the Header). Common methods include Basic Auth, Bearer Token, API Key, etc.
Instructions:
Method 1. Set authorization information through Auth globally (root directory), group (group settings), and interface (document editing page), supporting the following multiple authorization types
Bearer Token method
API Key method
Method 2. Manually write the token into the Header or other corresponding parameters (it is recommended to use environment variables to store the token). Example:
Bearer Token : Set a Header named Authorization and set the value to
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9yJpZCI6...
Or use environment variables and set the value to Bearer { {AUTH_TOKEN}}
Method 3. Set global parameters in the environment uniformly. Global parameters will be automatically added when all interfaces are running, eliminating the need to manually set each interface.
(over)