Postman uses records, a GET request with cookies, and a POST request that passes a JSON object to demonstrate __JS

Source: Internet
Author: User

Get request.

Get requests, just select the request type: Got, and then write to the URL address.
Some get requests are parameterized:
1, directly in the URL, the background to use @PathVariable receive parameters

2, the backstage use @RequestParam receive, can spell directly in the URL. You can also use the postman inside the URL input box after the "Params", and then enter the corresponding key, and the corresponding value.

Almost like this.


My example is a cookie-certified, so it's a problem where this cookie is added.


The example on the map on the URL of the IP, if it is the local, localhost is also possible.

This cookie is the value of this cookie that you can get after you log in, and I'm not going to show you how to get the cookie value.

This get request, simply with the cookie value, you can directly access the data.

As you can see on the diagram:

Returns the status code-status:200, the time-time:106ms, the size, and so on some common request information.

This background corresponds to the controller code screenshot as follows:


2 more graphs, and look at the display of that Cookie (2) and the header (4).



Then look at a GET request with parameters, using the @RequestParam received.


After you point the params, enter key and value below, then automatically spell the URL above.

The code screenshot of the corresponding background controller is as follows:


POST Request

The POST request takes a cookie with the JSON object data. Concrete examples of.

First add the cookie to the headers, then select Raw in the body behind it, then select JSON and then put your JSON object on the OK


About the front of the headers inside only set a cookie, but the back is a content-type this is selected raw, automatically appear.

So you can post it.

This corresponds to the background controller code screenshot below.


The return of the cookies and headers on that page are all the same. It's not on the map.


A simple record of how to use this tool, if the old iron asked me, I will directly to a link, than I Balabala said half a day works. Well, maybe it's too easy. I'll just make a note.

Feel the simple old iron, or the table sprayed me yo.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.