HTTP protocol----Request method and Status code

Source: Internet
Author: User

Now widely used is the http/1.1 version, released in 1997.

Understanding the HTTP protocol begins with the request, such as:

Post/form/entry http/1.1

format : request method URI Protocol version

Request Method :

get: Gets the resource specified by the URI, the main purpose is to obtain

POST: Transfers the principal to a URI, the primary purpose of which is to transmit , not to get

PUT: Transfers A file , contains the contents of the file in the request body, and then saves to the location specified by the URI.

head: Gets the head of the get result only, removing the body.

Delete: remove file , is put inverse operation

Options: Query The method that specifies the resource support for the request URI. Usage such as:

OPTIONS * http/1.1

Host:xxx

Note : Because the put and delete methods involve direct manipulation of server files , the general web site is not supported.

Unless a web authentication mechanism is used with the.

Common Status Codes :

1XX: Indicates a message

2XX: Success

The OK request succeeds, and the content is returned

204 No content: Requests are processed successfully, but nothing is returned

206:partial content: The server sends back a range of contents as requested by the client.

3XX: redirect

301:moved permanently: The requested resource has been permanently assigned a new URI, this time with the new URI access

302:found: The requested resource has been temporarily assigned a new URI, this time with a new URI access

As you can see, either 301 or 302, the requested resource has two URIs

303:see Other: Similar to 302, request resource has a new URI, get to obtain

304:not Modified: The resource was found but did not meet the conditions contained in the request message (not related to redirection)

4XX: Client Error

400:bad Request: There is a syntax error in the requested message

401:unauthorized: No authentication information is included in the sent request, or authentication failed

403:forbidden: Access denied (such as permissions and other issues)

404:not Found: No URI specified resource on the server

5XX: Server Error

500:internal Server error: Server side errors occurred while executing the request

503:service Unavailable: The server is unable to process the request (server is overloaded or maintenance, etc.)

HTTP protocol----Request method and Status code

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.