The two most common HTTP methods: GET and POST.
Hypertext Transfer Protocol (HTTP) is designed to ensure the communication between the client and the server.
HTTP works by requests between clients and servers - response protocol.
web browser may be the client, and network applications on the computer may also be used as the server.
Example: the client (browser) to submit an HTTP request to the server; the server returns the response to the client. The response contains status information about the request and the content may be requested.
Between the client and the server request - response to the two most commonly used methods are: GET and POST.
Please note that the query string (name / value pairs) are sent in the URL GET request:
GET requests about some of the other comments:
Please note that the query string (name / value pairs) are sent in an HTTP POST request message body of:
POST /test/demo_form.asp HTTP/1.1 Host: w3mys.com name1=value1&name2=value2
POST requests about some of the other comments:
The following table compares the two HTTP methods: GET and POST.
|Back button / refresh||harmless||Data will be re-submitted (the browser should inform the user data will be re-submitted).|
|Bookmarks||Can be bookmarked||Can not be bookmarked|
|Caching||Be cached||You can not cache|
|Encoding type||application / x-www-form-urlencoded||application / x-www-form-urlencoded or multipart / form-data. Use of multiple encoded binary data.|
|history||Parameter remains in the browser history.||Parameters are not saved in the browser history.|
|Restrictions on the length of the data||Yes. When transmitting data, GET method add data to the URL; URL length is limited (maximum length of the URL is 2048 characters).||Unlimited.|
|Restrictions on data types||Only ASCII characters are allowed.||unlimited. Also allows binary data.|
Compared with the POST, GET is less secure, because the transmitted data is part of the URL.
When sending passwords or other sensitive information should never be used GET!
|POST is more secure than GET, because the parameters are not saved in the browser history or web server logs.|
|Visibility||Data in the URL is visible to everyone.||Data does not appear in the URL.|
The following table lists some of the other HTTP request methods:
|HEAD||And GET the same, but returns only the HTTP header does not return the document body.|
|PUT||Upload the specified URI representation.|
|DELETE||Delete the specified resource.|
|OPTIONS||Returns server supports HTTP methods.|
|CONNECT||The request is connected to the transparent conversion of TCP / IP channel.|