Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

One of the basic knowledge of 5.httpd

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Common request methods for HTTP:

1.HEAD

Request a response from the server that is consistent with the GET request, but the response body will not be returned. This method can obtain the meta-information contained in the response header without having to transmit the entire response content. (only request the http header in the corresponding message)

2.GET

A request is made to a specific resource and the server returns the specified resource.

3.POST

Submit data to the specified resource for processing requests (such as submitting a form or uploading a file). The data is contained in the request body. POST requests may result in the creation of new resources and / or modification of existing resources.

4.PUT

Upload the latest content to the specified resource location

5.DELETE

Request the server to delete the resource identified by Request-URL

6.TRACE

Echo requests received by the server, mainly for testing or diagnostics

7.CONNECT

The HTTP/1.1 protocol is reserved for proxy servers that can change connections to pipelines.

8.OPTIONS

Allows clients to view the performance of the server.

HTTP status code

When a viewer visits a web page, the viewer's browser makes a request to the server where the web page is located. Before the browser receives and displays the web page, the server where the web page is located will return an information header (server header) containing the HTTP status code in response to the browser's request.

The English word for HTTP status code is HTTP Status Code.

Here are common HTTP status codes:

200-request succeeded

301-Resources (web pages, etc.) are permanently transferred to other URL

404-the requested resource (web page, etc.) does not exist

500-Internal server error

HTTP status code classification

The HTTP status code consists of three decimal digits. The first decimal number defines the type of the status code, and the last two digits have no classification function. There are 5 types of HTTP status codes:

HTTP status code classification description 1 request * message, the server receives the request, requires the requester to continue to perform the operation 2 successfully, the operation is successfully received and processed 3 requests * redirection, requires further operation to complete the request 4 requests * client error, the request contains syntax errors or cannot complete the request 5 requests * server error, the server encountered an error in the process of processing the request

List of HTTP status codes:

HTTP status code list status code status code English name Chinese description

100 Continue continues. The client should continue its request

101Switching Protocols switching protocol. The server switches the protocol according to the request of the client. You can only switch to a more advanced protocol, for example, to a new version of HTTP

200 OK request succeeded. Commonly used for GET and POST requests

201 Created has been created. Successfully requested and created a new resource

202 Accepted accepted. The request has been accepted but the processing has not been completed

203 Non-Authoritative Information unauthorized information. The request was successful. But the returned meta information is not on the original server, but on a copy.

204 No Content has no content. The server successfully processed but did not return content. If the web page is not updated, ensure that the browser continues to display the current document

205 Reset Content resets the content. The server is processed successfully, and the user terminal (for example, browser) should reset the document view. The form field of the browser can be cleared by this return code

206part of Partial Content. The server successfully processed some GET requests

300 Multiple Choices multiple options. The requested resource may include multiple locations, which can return a list of resource characteristics and addresses for user terminal (e. G. browser) selection

301 Moved Permanently permanent move. The requested resource has been permanently moved to the new URI, the returned information will include the new URI, and the browser will be automatically directed to the new URI. Any new requests in the future should be replaced by a new URI

302 Found temporary movement. Similar to 301. But resources are only temporarily moved. The client should continue to use the original URI

303 See Other look at other addresses. Similar to 301. Use GET and POST to request view

304Not Modified has not been modified. The requested resource has not been modified, and when the server returns this status code, no resource will be returned. The client usually caches the accessed resources, indicating that the client wants to return only those resources that have been modified after the specified date by providing a header information

305 Use Proxy uses proxies. The requested resource must be accessed through an agent

306 Unused obsolete HTTP status code

307 Temporary Redirect temporary redirection. Similar to 302. Request redirection using GET

The syntax error of 400 Bad Request client request is too bad for the server to understand

401 Unauthorized request requires user's identity authentication

402 Payment Required reserved for future use

The Forbidden server understands the request of the requesting client, but refuses to execute the request

The Not Found server cannot find the resource (web page) according to the client's request. Through this code, the website designer can set up a personality page that the resource you requested cannot be found.

Methods in 405 Method Not Allowed client requests are prohibited

The 406 Not Acceptable server cannot complete the request according to the content characteristics of the client request

The 407 Proxy Authentication Required request requires the authentication of the agent, similar to 401, but the requester should use the agent for authorization

The 408 Request Time-out server waited too long for the request sent by the client, and timed out

When the Conflict server completes the client's PUT request, it is possible to return this code, and a conflict occurred when the server processed the request.

The resource requested by the 410 Gone client no longer exists. 410 is different from 404, if the resource has been permanently deleted and can use 410 code, the website designer can specify the new location of the resource through 301 code.

411 the Length Required server cannot process the request information sent by the client without Content-Length

412 precondition error for Precondition Failed client request information

413 Request Entity Too Large rejected the request because the requested entity was too large for the server to process. To prevent continuous requests from the client, the server may close the connection. If only the server cannot process it temporarily, it will contain a Retry-After response message.

414 the URI of the Request-URI Too Large request is too long (the URI is usually the URL) and the server cannot process it.

415 the Unsupported Media Type server cannot process the media format that comes with the request

Invalid scope requested by 416 Requested range not satisfiable client

417 Expectation Failed server cannot satisfy the request header information of Expect

500 Internal Server Error server internal error, unable to complete the request

501 Not Implemented server does not support the requested function and cannot complete the request

502 Bad Gateway server acting as a gateway or proxy received an invalid request from the remote server

503 Service Unavailable due to overload or system maintenance, the server is temporarily unable to process client requests. The length of the delay can be included in the server's Retry-After header information

Gateway Time-out acts as a gateway or proxy server and fails to obtain requests from remote servers in a timely manner

505 HTTP Version not supported server does not support the version of the requested HTTP protocol and cannot complete the processing

Check the status code: # curl-I HTTP/1.1 200 OKServer: bfe/1.0.8.18Date: Tue, 13 Jun 2017 08:05:40 GMTContent-Type: text/htmlContent-Length: 277Last-Modified: Mon, 13 Jun 2016 02:50:08 GMTETag: "575e1f60-2016" Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transformPragma: no-cacheAccept-Ranges: bytesX-Cache: MISS from netentsec-nps-172.17.18.80Connection: keep-alive

Http message

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report