For front-end developers, the most important thing is not the technology itself. In fact, the technology is not difficult, but the most lacking is a variety of good weapons, such as debugging and development tools.
We recommend Postman, a front-end development tool, which is a tool for Google Chrome Web Store to help us test RESTful APIs, we can add arbitrary http headers for REST calls, simulate REST calls, and test the results.
Installation:
The installation is simple. First, make sure there is an available Google Account.
(1) Open Google Chrome
(2) enter the following url: https://chrome.google.com/webstore/detail/fdmmgilgnpjigdojojpjoooidkmcomcm
Select"Add to Chrome", As follows:
650) this. width = 650; "border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131228/124T95943-0.png "/>
Then, a dialog box is displayed for installation:
650) this. width = 650; "border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131228/124T95120-1.png "/>
Finally, select the "Start application" button in the upper-right corner to correctly start the "Postman" Application in Chrome:
650) this. width = 650; "border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131228/124T92555-2.png "/>
Example:
Next we will demonstrate how to use Postman to test the rest api:
For example, I want to test the following RESTful API:
Http://sdc-d1-payment-app1.gecwalmart.com: 8080/PaymentService/api/portlets/findPayment? PaymentHandle = BO-Nitz1-5678912340_12345_69 & clientOrderNumber = BO-Nitz1-69
In addition, as agreed by both parties, in order to access this request URL, I must connect to the company VPN and set some Mandatory custom headers. These headers are listed as follows:
[HeaderKey: WM_CONSUMER.IP, headerValue: 127.0.0.1]
[HeaderKey: WM_SVC.ENV, headerValue: DEV]
[HeaderKey: WM_SVC.ENV, headerValue: DEV]
[HeaderKey: WM_QOS.CORRELATION_ID, headerValue: fd9bf2a9-0951-40c6-a0f3-22f5935b304e] // this is GUID
[HeaderKey: WM_SEC.AUTH_TOKEN, headerValue: ahha % &! ^ !) (! &]
[HeaderKey: WM_CONSUMER.INTIMESTAMP, headerValue: 1346956253326]
[HeaderKey: WM_IFX.CLIENT_TYPE, headerValue: PORTAL]
[HeaderKey: WM_CONSUMER.ID, headerValue: 100]
We only need to input HTTP action (POST/GET/PUT/DELETE), request URL, parameter, and Header respectively,
650) this. width = 650; "border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131228/124T942X-3.png "/>
Then select Send, and the test result is displayed as follows:
650) this. width = 650; "border =" 0 "alt =" "src =" http://www.bkjia.com/uploads/allimg/131228/124T92301-4.png "/>
On the left side, we can see the sent action and URL. below is the jsonPayload of the obtained RESTful API call result, and it has already been formatted, so it is very clear.
This article from "parallel line cohesion" blog, please be sure to keep this source http://supercharles888.blog.51cto.com/609344/985651