HTTP methods-get and Post

Source: Internet
Author: User

The Hypertext Transfer Protocol (HTTP) is designed to ensure communication between the client and the server.
HTTP works as a request-response protocol between the client and the server.
A Web browser might be a client, and a network application on a computer might be a server-side.
Example: the client (browser) submits an HTTP request to the server, and the server returns a response to the client. The response contains status information about the request and what might be requested.
Two methods of HTTP request: GET and POST
GET-Requests data from the specified resource.
POST-submits the data to be processed to the specified resource

1. GET method
The query string (name/value pair) is sent in the URL of the GET request:

/test/demo_form.asp?name1=value1&name2=value2

Get requests can be cached
GET requests remain in browser history
Get requests can be bookmark-Favorites
GET requests should not be used when handling sensitive data
Get request has a length limit
GET requests should only be used to retrieve data

2. POST method
The query string (name/value pair) is sent in the HTTP message body of the POST request:

post/test/demo_form.asp http/1.1host:w3schools.comname1=value1 &name2=value2

POST requests are not cached
POST requests are not persisted in browser history
POST cannot be bookmarked
POST request has no requirement for data length

Comparison of 2 different methods

HTTP methods-get and Post

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.