Postman Analog HTTP Requests

Source: Internet
Author: User
Tags text to json

One, HTTP requests (describe only get and post requests)

1, GET request: Directly display the parameter name and value in the URL, the request length is limited

For example, request userid=1 user information, url:http://hostname/getuser?userid=1

2. Post request: The data is placed in the body for transmission, so the requested parameters are not exposed in the URL. The data for the post request can be very large and may modify resources on the server. The POST request requires tools such as Postman

1) Uploading Files

2) Transfer JSON data type: Select Body-raw to change the last option text to JSON

3, the common status code: Web server HTTP response status of 3-digit code

1) 200:2 indicates that the request was sent successfully. 200 indicates that the request was sent successfully and the server returned

2) 302:3 indicates a redirect. 302 indicates that the requested resource is now temporarily responding to requests from different URIs. For example, open my Blog link, when my blog has been deleted, automatically jump to the blog home page

3) 400:400 indicates that the request sent by the client is not error-able. 403 means no access; 404 means the page visited does not exist

4) 500:5 indicates that the server has an exception. 500 indicates server internal exception, 504 indicates server timeout, no result returned

Second, Postman Analog HTTP request

1. Add header File

For example, get user information, http://hostname/getuser2?userid=1, and need to add header,Content-type:application/json

2. Add Cookie Verification

For example, modify the user balance: Http://hostname/setmoney2, need to add Cookie,token is written dead token12345

Postman Analog HTTP Requests

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.