SpringBoot actual combat e-commerce project mall (18K + STAR) Address: github.com/macrozheng/…
Abstract
Postman is an API interface debugging tool, which makes it easy to test the interface. In addition, the back-end personnel can export their debugging results for the convenience of the front-end personnel.
The installation
- Download address: www.getpostman.com/downloads/
- After downloading the installation package, double-click to install it.
Set up the
Theme Settings
I have to say that Postman’s interface is still pretty good, much better than Swagger’s. Postman offers two themes by default, a light color and a dark color, which can be opened via the File->Settings button in the upper left corner.
Adjust font size
The default font size may not be suitable for you, especially for computers with large screens. You can Zoom In and Zoom Out under the View.
Interface Debugging
All test interfaces come from mall-admin background and can be tested directly after startup.
Invoke the GET request
Call the POST request to submit the JSON-formatted data
Call the POST request to submit the form
Invoke the file upload interface
Invoke the interface you need to log in to
Call the login interface to get the token
Sets the token header and invokes the interface you want to log in to
Debug file import and export
Save debugging interface information
Example Export debugging information in a Collection
Import debugging information in the Collection
Use some techniques in the process
Set up different environments
When we develop, we will divide the local environment and the test environment. The local environment is used for the local debugging interface, and the test environment is used for the front and back end intermodulation interface. Above we write the IP port http://localhost:8080 directly in the request path, when we want to debug the test environment interface, it will cause trouble. Defining multiple environment variables and referencing them in the interface address solves this problem.
Adding a Local Environment
Adding a test environment
Reference environment variables
Environment variable switching
Set up a common login token
When we have many interfaces that need login token headers, if the previously used token is invalid, then all interface token headers need to be modified. Here we can define the login token and reference it again, so that the token is invalid, only one need to modify.
The public,
Mall project full set of learning tutorials serialized, attention to the public number the first time access.