HTTP requests can use avariety of request methods, depending on the HTTP standard .
HTTP1.0 defines three methods of request: GET, POST, and HEAD .
HTTP1.1 has five new request methods:options, PUT, DELETE, TRACE , and CONNECT methods.
|
Serial number |
Method |
Describe |
|
1 |
GET |
Requests the specified page information and returns the entity principal. |
|
2 |
HEAD |
Similar to a get request, except that there is no specific content in the returned response to get the header |
|
3 |
POST |
Submits data to the specified resource for processing requests (such as submitting a form or uploading a file). The data is included in the request body. POST requests may lead to the creation of new resources and / or a modification of an existing resource. |
|
4 |
PUT |
Supersedes the contents of the specified document from the data that the client sends to the server. |
|
5 |
DELETE |
Requests that the server delete the specified page. |
|
6 |
CONNECT |
The http/1.1 protocol is reserved for proxy servers that can change connections to pipelines. |
|
7 |
OPTIONS |
Allows clients to view server performance. |
|
8 |
TRACE |
echo the requests received by the server, primarily for testing or diagnostics. |
1.6.1 GET Request
The HTTP request message sent by the browser is requested as a GET Request:
1 . Enter a URL address in the Explorer Bar or click a hyperlink on a webpage if the <form> Table element property is set to "GET"
2. Format the parameters for the WEB server :
Http://www.dongfeng.com/index.html?name=admin&password=123
3. Note: The amount of data transmitted using GET is generally below 1KB .
1.6.2 POSTRequest
To pass a parameter using the POST method :
1. The table cell method property is set to "POST"
2. POST transmits more data
3. POST requests are primarily intended for the WEB Server to submit the data in form forms
1.7 HTTPStatus Code
When a viewer accesses a webpage, the browser of the viewer makes a request to the server where the page is located. When a Web page is received and displayed by the browser, the server on which the page resides returns a message header (server header) that contains the HTTP status code torespond to the browser's request. http status code in English is httpstatus code.
The following are the common HTTP status codes:
Ø200- Successful request
ø301- Resources (Web pages, etc.) are permanently transferred to other URLs
ø404- The requested resource (Web page, etc.) does not exist
Ø500- Internal server error
1.8 HTTPStatus Code Classification
The HTTP status code consists of three decimal digits, the first decimal number defines the type of the status code, and the latter two numbers do not have a function of classification. There are 5 types of HTTP status Codes :
|
Classification |
HTTP Status Code classification description |
|
1** |
Information, the server receives the request and requires the requestor to continue the operation |
|
2** |
Successful, the operation is successfully received and processed |
|
3** |
Redirect, requires further action to complete the request |
|
4** |
Client error, request contains syntax error or cannot complete request |
|
5** |
Server error, the server has an error while processing the request |
1.9 HTTP Content-type
Content-type, content type, generally refers to the presence of Content-type in a Web page , which defines the type of network file and the encoding of the Web page, and determines in what form and in what encoding the browser will read the file.
HTTP request method and request status