In our usual development, especially the need to deal with the interface, whether it is written interface or interface, get the interface must be tested in advance, so it is very necessary to have a comparison to the force of the HTTP request simulation tool, now popular this tool is quite many, Like Firefox plugin-restclient,chrome browser plugin-postman and so on. Here is the main introduction of postman.
I. description ofPostman
Postman is a Chrome plugin for Web page debugging and sending Web HTTP requests. We can use it to easily simulate a get or post or other request to debug an interface.
Second, install (Install to chrome plugin)
At the time of installation, it is best to open the Chrome Web Store directly to the chrome plugin via Chrome browser. If you download postman directly from the Internet, you may not be able to press chrome up.
To enter the chrome Web Store needs FQ, here by default you can FQ, the general steps are as follows:
- Open the Chrome Web Store in chrome and search for postman.
- Click Add to Chrome.
Iii. Basic methods of use
Note: Here is an example of a POST request that submits a multilayer nested JSON data format.
Such as:
1 data= 2 {3 "xxx": 4 {5 "xxx": "Xxxxxxxxxxx", 6 "xxx": "Xxxxxxxxxxx" 7 }, 8 "AAA": "Xxxxxxxxx XX ", 9 " BBB ":" Xxxxxxxxxxx "," CCC ":" Xxxxxxxxxxx "11}
1, after installing the Postman plug-in in chrome, usually generate a postman shortcut on the desktop, you can open it again directly through the shortcut can also be opened in the Chrome browser app, we will see the following interface:
2, open, in the red circle enter the need to test the interface address, select the Post method, and then manually add a corresponding key value in the following headers. This is key, be sure to fill in the right.
(such as: JSON-formatted submission data needs to be added: content-type:application/x-www-form-urlencoded, otherwise it will cause the request to fail)
3. Select the Body tab, then select row and enter the parameters you want to submit in the edit box:
4, click Send to submit the request, and then view the request results below, and can be viewed in pretty, Raw, preview three ways.
Note: This document simply gave an example to meet our daily test, more details can be logged Postman official website: https://www.getpostman.com
Postman Usage Profile-http Request Simulation Tool