Introduction to HTTP status code (HTTP codes)

Source: Internet
Author: User

HTTP and Status codes

HTTP may be familiar to everyone, that is, Hypertext Transfer Protocol. The browser communicates with the Web server via HTTP (and some other software, such as IM using the HTTP protocol), passes our request (HTTP request) to the server, the server responds to the request, and returns the reply (HTTP Response) and the data we need. That's roughly what it looks like.

If we ask for anything, the server returns what it is, and it doesn't need the HTTP Status codes. But things are not always that simple. For example, we request a page page, but the server does not exist this page, or the page is moved to another place, or the server prohibits us from viewing this page, etc., so in order to facilitate the browser to handle these correct and incorrect situation, HTTP with the status codes to represent the request (HTTP Request) is handled in the server-side case. Status codes is returned to the browser via an answer (HTTP Response), which is handled accordingly by the browser.

Categories of HTTP Status codes

Since there is a correct and wrong state, HTTP definition two categories of status code is it possible? The person who made the agreement was an expert (not as I was impersonating), thinking better than we are, and in the long run. The 5 major categories of status codes are defined in HTTP 1.1, respectively:

Informational
Meaning: Information
Range: 1XX

Successful
Meaning: Success
Range: 2XX

Redirection
Meaning: redirect
Range: 3XX

Client Error
Meaning: Client Error
Range: 4XX

Server Error
Meaning: Server error
Range: 5XX

You see how thoughtful people think, real experts are real experts.

Introduction to common HTTP Status codes

Here's a brief look at the HTTP Status codes we often encounter.

Perhaps I ignorant, often encounter the HTTP Status codes just a few, laughed at.

Successful
200-ok:ok
This is the most common (maybe we won't see it directly, but if you use some of the grab kits, this is true in most HTTP responses). The meaning is simple, that is, the server receives and understands the client's request and processes it properly.
206-partial content: Part of the contents.
This also happens often. It's easy to get people to rip their hair off.
The popular point is that if the client requests a portion of the document (image, text, sound, etc.), the server normally processes it, then returns 206. The approximate meaning is that when it is requested, the offset and length are specified in addition to the requested content.
Part of the content, is not mistaken? Oh no mistake, now many browsers and software support Breakpoint continued to rely on this. Oh, after seeing 206 don't be afraid of.

Redirection
301-moved permanently: permanently moving.
This status code refers to the client's request for the resources have been permanently transferred to a new place. This answer (HTTP Response) contains the new address of the resource. It tells the client that if you want this resource next time, you can use the new address to fetch it.
302 Found: Temporary redirection.
This status code refers to the resources the client is requesting is temporarily placed in a new place. Similarly, a new address for the resource is included in the answer.
307-temporary Redirect: Temporary redirection. (If we don't implement the protocol or develop it, we understand that it's about 302 or so.)
There's an article on redirection, "302 redirects from business.com," very interesting.
We have reproduced a copy, address: http://bbs.netpu.net/viewthread.php?tid=810

Client Error
400-bad Request: Error requests
is the syntax error of the request and the server cannot understand it.
401–unauthorized: Not authorized
When the server returns 401 Code, it tells the client that it must pass the server's authorization before accessing the specified resource.
403–forbidden: No Access
is to not allow access to certain resources.
404-not Found: Not Found
The content requested by the client could not be found

Server Error
500-internal Server Error
Server internal error.

Introduction to HTTP status code (HTTP codes)

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.