search
HomeWeb Front-endJS TutorialHTTP status codes and definitions (explanations)_Basic knowledge

Recently, I often worry about the status of Ajax requests or the status of server-side cross-domain requests. Now save the following article.

When we usually browse the web, we will also find that some files are displayed as "404 errors" when they do not exist. This is the common Http request status (status)

The web server responds to the browser or When requested by other client programs, the response generally consists of the following parts: a status line, several response headers, a blank line, and a content document. The following is the simplest response:

The status line contains the HTTP version, status code, and a brief description corresponding to the status code. In most cases, all response headers except Content-Type are optional. But Content-Type is required, it describes the MIME type of the subsequent document. While most responses include a document, some do not; for example, responses to HEAD requests never come with a document. There are many status codes that actually identify a failed request, and these responses also contain no documentation (or only a brief error message).

When a user attempts to access content on a server running Internet Information Services (IIS) via HTTP, IIS returns a numeric code indicating the status of the request. Status codes can indicate whether a specific request was successful and can also reveal the exact reason why the request failed.

1xx - Information prompt

These status codes indicate temporary responses. The client should be prepared to receive one or more 1xx responses before receiving a regular response.
· 100 - Continue The initial request has been accepted and the client should continue sending the remainder of the request. (New in HTTP 1.1)
· 101 - Switching Protocols The server will comply with the client's request and convert to another protocol (New in HTTP 1.1)

2xx - Successful

This type of status code indicates The server successfully accepted the client request.
· 200 - OK Everything is fine, and the response documents for GET and POST requests follow.
· 201 - Created The server has created the document, and the Location header gives its URL.
· 202 - Accepted The request has been accepted, but the processing has not yet been completed.
· 203 - Non-Authoritative Information The document has been returned normally, but some response headers may be incorrect because a copy of the document is used, non-authoritative information (new in HTTP 1.1).
· 204 - No Content There is no new document, the browser should continue to display the original document. This status code is useful if the user refreshes the page regularly and the servlet can determine that the user's document is current enough.
· 205 - Reset Content No new content, but the browser should reset the content it displays. Used to force the browser to clear form input content (new in HTTP 1.1).
· 206 - Partial Content The client sent a GET request with a Range header and the server completed it (new in HTTP 1.1).

3xx - Redirect

The client browser must take additional actions to fulfill the request. For example, the browser may have to request a different page on the server, or repeat the request through a proxy server.
· 300 - Multiple Choices The document requested by the client can be found in multiple locations, and these locations are listed in the returned document. If the server wants to propose a preference, it should indicate it in the Location response header.
· 301 - Moved Permanently The document requested by the client is elsewhere. The new URL is given in the Location header, and the browser should automatically access the new URL.
· 302 - Found Similar to 301, but the new URL should be considered a temporary replacement rather than a permanent one. Note that the corresponding status information in HTTP 1.0 is "Moved Temporatily".When this status code occurs, the browser can automatically access the new URL, so it is a useful status code. Note that this status code can sometimes be used interchangeably with 301. For example, if the browser incorrectly requests http://host/~user (missing the trailing slash), some servers will return 301 and some will return 302. Strictly speaking, we can only assume that the browser will automatically redirect only if the original request was a GET. See 307.
· 303 - See Other Similar to 301/302, except that if the original request was POST, the redirect target document specified by the Location header should be fetched via GET (new in HTTP 1.1).
· 304 - Not Modified The client has a buffered document and issued a conditional request (usually providing an If-Modified-Since header to indicate that the client only wants documents that are newer than the specified date). The server tells the client that the original buffered document can continue to be used.
· 305 - Use Proxy The document requested by the client should be retrieved through the proxy server specified by the Location header (new in HTTP 1.1).
· 307 - Temporary Redirect is the same as 302 (Found). Many browsers will incorrectly redirect with a 302 response, even if the original request was a POST, even though it can actually only redirect if the response to a POST request is a 303. For this reason, HTTP 1.1 added 307 to more clearly distinguish between several status codes: when a 303 response occurs, the browser can follow redirected GET and POST requests; if it is a 307 response, the browser can only follow Redirection of GET requests. (New in HTTP 1.1)

4xx - Client Error

An error occurred and there seems to be a problem with the client. For example, the client requests a page that does not exist, and the client does not provide valid authentication information.

· 400 - Bad Request A syntax error occurred in the request.

· 401 - Unauthorized Access is denied. The customer attempted to access a password-protected page without authorization. The response will contain a WWW-Authenticate header, and the browser will display the username/password dialog box accordingly, and then make the request again after filling in the appropriate Authorization header. IIS defines many different 401 errors, which indicate more specific causes of errors. These specific error codes show up in the browser, but not in the IIS logs:
· 401.1 - Login failed.
· 401.2 - Server configuration caused login failure.
· 401.3 - Not authorized due to ACL restrictions on resources.
· 401.4 - Filter authorization failed.
· 401.5 - ISAPI/CGI application authorization failed.
· 401.7 – Access is denied by the URL authorization policy on the web server. This error code is specific to IIS 6.0.

· 403 - Forbidden The resource is not available. The server understands the client's request but refuses to process it. Usually caused by the permission settings of files or directories on the server. Forbidden: IIS defines a number of different 403 errors, which indicate more specific error causes:
· 403.1 - Execution access is forbidden.
· 403.2 - Read access prohibited.
· 403.3 - Write access prohibited.
· 403.4 - Requires SSL.
· 403.5 - Requires SSL 128.
· 403.6 - IP address rejected.
· 403.7 - Client certificate required.
· 403.8 - Site access denied.
· 403.9 - Too many users.
· 403.10 - Invalid configuration.
· 403.11 - Password change.
· 403.12 - Access to mapping table denied.
· 403.13 - Client certificate revoked.
· 403.14 - Deny directory listing.
· 403.15 - Client access permission exceeded.
· 403.16 - Client certificate is not trusted or invalid.
· 403.17 - The client certificate has expired or is not yet valid.
· 403.18 - The requested URL cannot be executed in the current application pool. This error code is specific to IIS 6.0.
· 403.19 - Cannot perform CGI for clients in this application pool. This error code is specific to IIS 6.0.
· 403.20 - Passport login failed. This error code is specific to IIS 6.0.

· 404 - Not Found The resource at the specified location cannot be found. This is also a common response.
· 404.0 - (None) – File or directory not found.
· 404.1 - The web site cannot be accessed on the requested port.
· 404.2 - This request is blocked by the Web Services extension locking policy.
· 404.3 - MIME mapping policy blocks this request.

· 405 - Method Not Allowed The request method (GET, POST, HEAD, Delete, PUT, TRACE, etc.) is not applicable to the specified resource, and the HTTP verb used to access this page is not allowed (the method is not Allow) (New in HTTP 1.1)
· 406 - Not Acceptable The specified resource has been found, but its MIME type is incompatible with the one specified by the client in the Accpet header. The client browser does not accept the MIME type of the requested page. (New in HTTP 1.1).
· 407 - Proxy Authentication Required requires proxy authentication, similar to 401, indicating that the client must first be authorized by the proxy server. (New in HTTP 1.1)
· 408 - Request Timeout The client has not issued any request during the waiting time allowed by the server. The client can repeat the same request later. (New in HTTP 1.1)
· 409 - Conflict Usually related to PUT requests. The request cannot succeed because it conflicts with the current state of the resource. (New in HTTP 1.1)
· 410 - Gone The requested document is no longer available, and the server does not know which address to redirect to. The difference between it and 404 is that returning 407 means that the document has permanently left the specified location, while 404 means that the document is unavailable for unknown reasons. (New in HTTP 1.1)
· 411 - Length Required The server cannot process the request unless the client sends a Content-Length header. (New in HTTP 1.1)
· 412 - Precondition Failed Some preconditions specified in the request header failed (New in HTTP 1.1).
· 413 – Request Entity Too Large The size of the target document exceeds the size that the server is currently willing to handle. If the server thinks it can handle the request later, it should provide a Retry-After header (new in HTTP 1.1).
· 414 - Request URI Too Long URI is too long (new in HTTP 1.1).
· 415 – Unsupported media type.
· 416 – Requested Range Not Satisfiable The server cannot satisfy the Range header specified by the client in the request. (New in HTTP 1.1)
· 417 – Execution failed.
· 423 – Locking error.

5xx - Server Error

The server was unable to complete the request because it encountered an error.

· 500 - Internal Server Error The server encountered an unexpected situation and was unable to complete the client's request.

· 500.12 - The application is busy restarting on the web server.
· 500.13 - The web server is too busy.
· 500.15 - Direct requests to Global.asa are not allowed.
· 500.16 – UNC authorization credentials are incorrect. This error code is specific to IIS 6.0.
· 500.18 – The URL authorization store cannot be opened. This error code is specific to IIS 6.0.
· 500.100 - Internal ASP error.

· 501 - Not Implemented The server does not support the functionality required to implement the request, and the header value specifies an unimplemented configuration. For example, the client makes a PUT request that the server does not support.

· 502 - Bad Gateway When the server acts as a gateway or proxy, it accesses the next server to complete the request, but the server returns an illegal response. It is also said that the web server received an invalid response when acting as a gateway or proxy server.

· 502.1 - CGI application timed out.
· 502.2 - CGI application error.

· 503 - Service Unavailable The service is unavailable. The server failed to respond due to maintenance or overload. For example, a Servlet may return 503 when the database connection pool is full. The server can provide a Retry-After header when returning 503. This error code is specific to IIS 6.0.

· 504 - Gateway Timeout Gateway timeout, used by servers acting as proxies or gateways, indicates that a response cannot be obtained from the remote server in a timely manner. (New in HTTP 1.1).

· 505 - HTTP Version Not Supported The server does not support the HTTP version specified in the request. (New in HTTP 1.1).

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
From Websites to Apps: The Diverse Applications of JavaScriptFrom Websites to Apps: The Diverse Applications of JavaScriptApr 22, 2025 am 12:02 AM

JavaScript is widely used in websites, mobile applications, desktop applications and server-side programming. 1) In website development, JavaScript operates DOM together with HTML and CSS to achieve dynamic effects and supports frameworks such as jQuery and React. 2) Through ReactNative and Ionic, JavaScript is used to develop cross-platform mobile applications. 3) The Electron framework enables JavaScript to build desktop applications. 4) Node.js allows JavaScript to run on the server side and supports high concurrent requests.

Python vs. JavaScript: Use Cases and Applications ComparedPython vs. JavaScript: Use Cases and Applications ComparedApr 21, 2025 am 12:01 AM

Python is more suitable for data science and automation, while JavaScript is more suitable for front-end and full-stack development. 1. Python performs well in data science and machine learning, using libraries such as NumPy and Pandas for data processing and modeling. 2. Python is concise and efficient in automation and scripting. 3. JavaScript is indispensable in front-end development and is used to build dynamic web pages and single-page applications. 4. JavaScript plays a role in back-end development through Node.js and supports full-stack development.

The Role of C/C   in JavaScript Interpreters and CompilersThe Role of C/C in JavaScript Interpreters and CompilersApr 20, 2025 am 12:01 AM

C and C play a vital role in the JavaScript engine, mainly used to implement interpreters and JIT compilers. 1) C is used to parse JavaScript source code and generate an abstract syntax tree. 2) C is responsible for generating and executing bytecode. 3) C implements the JIT compiler, optimizes and compiles hot-spot code at runtime, and significantly improves the execution efficiency of JavaScript.

JavaScript in Action: Real-World Examples and ProjectsJavaScript in Action: Real-World Examples and ProjectsApr 19, 2025 am 12:13 AM

JavaScript's application in the real world includes front-end and back-end development. 1) Display front-end applications by building a TODO list application, involving DOM operations and event processing. 2) Build RESTfulAPI through Node.js and Express to demonstrate back-end applications.

JavaScript and the Web: Core Functionality and Use CasesJavaScript and the Web: Core Functionality and Use CasesApr 18, 2025 am 12:19 AM

The main uses of JavaScript in web development include client interaction, form verification and asynchronous communication. 1) Dynamic content update and user interaction through DOM operations; 2) Client verification is carried out before the user submits data to improve the user experience; 3) Refreshless communication with the server is achieved through AJAX technology.

Understanding the JavaScript Engine: Implementation DetailsUnderstanding the JavaScript Engine: Implementation DetailsApr 17, 2025 am 12:05 AM

Understanding how JavaScript engine works internally is important to developers because it helps write more efficient code and understand performance bottlenecks and optimization strategies. 1) The engine's workflow includes three stages: parsing, compiling and execution; 2) During the execution process, the engine will perform dynamic optimization, such as inline cache and hidden classes; 3) Best practices include avoiding global variables, optimizing loops, using const and lets, and avoiding excessive use of closures.

Python vs. JavaScript: The Learning Curve and Ease of UsePython vs. JavaScript: The Learning Curve and Ease of UseApr 16, 2025 am 12:12 AM

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

Python vs. JavaScript: Community, Libraries, and ResourcesPython vs. JavaScript: Community, Libraries, and ResourcesApr 15, 2025 am 12:16 AM

Python and JavaScript have their own advantages and disadvantages in terms of community, libraries and resources. 1) The Python community is friendly and suitable for beginners, but the front-end development resources are not as rich as JavaScript. 2) Python is powerful in data science and machine learning libraries, while JavaScript is better in front-end development libraries and frameworks. 3) Both have rich learning resources, but Python is suitable for starting with official documents, while JavaScript is better with MDNWebDocs. The choice should be based on project needs and personal interests.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.