How to get HTTP status messages
Anyone who has done Socket programming in HTTP request style knows that when we design a communication protocol, the "message header/message body" separation method is very commonly used. The message header tells the other party what the message is for, and the message body Tell the other person what to do.
When the browser requests services from the web server, errors may occur. It is possible to return the following series of status messages:
1xx: Message
Message: | describe: |
---|---|
100 Continue | The server receives only part of the request, but once the server does not reject the request, the client should continue to send the remaining requests. |
101 Switching Protocols | Server conversion protocol: The server will comply with the client's request and convert to another protocol. |
2xx: Success
Message: | describe: |
---|---|
200 OK | Request successful (followed by response documents to GET and POST requests.) |
201 Created | The request is created and new resources are created. |
202 Accepted | The request for processing has been accepted, but processing is not completed. |
203 Non-authoritative Information | The document has been returned normally, but some response headers may be incorrect because a copy of the document was used. |
204 No Content | No new documents. 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 documents. But the browser should reset what it displays. Used to force the browser to clear form input content. |
206 Partial Content | The client sent a GET request with a Range header and the server completed it. |
3xx: Redirect
Message: | describe: |
---|---|
300 Multiple Choices | Multiple selections. Linked list. Users can select a link to reach their destination. A maximum of five addresses are allowed. |
301 Moved Permanently | The requested page has been moved to the new url. |
302 Found | The requested page has been temporarily moved to the new URL. |
303 See Other | The requested page can be found under another URL. |
304 Not Modified | The document was not modified as expected. The client has a buffered document and makes a conditional request (usually by 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 | Documents requested by the client should be retrieved through the proxy server specified by the Location header. |
306 Unused | This code was used in the previous version. It is no longer in use, but the code is still retained. |
307 Temporary Redirect | The requested page has been temporarily moved to the new URL. |
4xx: Client error
Message: | describe: |
---|---|
400 Bad Request | The server failed to understand the request. |
401 Unauthorized | The requested page requires a username and password. |
402 Payment Required | This code is not available yet. |
403 Forbidden | Access to the requested page is prohibited. |
404 Not Found | The server cannot find the requested page. |
405 Method Not Allowed | The method specified in the request is not allowed. |
406 Not Acceptable | The response generated by the server was not acceptable to the client. |
407 Proxy Authentication Required | Users must first authenticate using a proxy server so that the request will be processed. |
408 Request Timeout | The request exceeded the server's waiting time. |
409 Conflict | The request could not be completed due to a conflict. |
410 Gone | The requested page is unavailable. |
411 Length Required | "Content-Length" is not defined. Without this content, the server will not accept the request. |
412 Precondition Failed | The precondition in the request was evaluated as failed by the server. |
413 Request Entity Too Large | The server will not accept the request because the requested entity is too large. |
414 Request-url Too Long | The server will not accept the request because the url is too long. This happens when a POST request is converted into a GET request with very long query information. |
415 Unsupported Media Type | The server will not accept the request because the media type is not supported. |
416 | The server cannot satisfy the Range header specified by the client in the request. |
417 Expectation Failed |
5xx: Server Error
Message: | describe: |
---|---|
500 Internal Server Error | The request is not completed. The server encountered an unpredictable situation. |
501 Not Implemented | The request is not completed. The server does not support the requested functionality. |
502 Bad Gateway | The request is not completed. The server received an invalid response from the upstream server. |
503 Service Unavailable | The request is not completed. The server is temporarily overloaded or down. |
504 Gateway Timeout | Gateway timeout. |
505 HTTP Version Not Supported | The server does not support the HTTP protocol version specified in the request. |
Related recommendations:
HTTP preliminary annotation-Yitoem
PHP Modify HTTP header-Modify HTTP Headers
The above is the detailed content of How to get HTTP status messages. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Face detection and recognition technology is already a relatively mature and widely used technology. Currently, the most widely used Internet application language is JS. Implementing face detection and recognition on the Web front-end has advantages and disadvantages compared to back-end face recognition. Advantages include reducing network interaction and real-time recognition, which greatly shortens user waiting time and improves user experience; disadvantages include: being limited by model size, the accuracy is also limited. How to use js to implement face detection on the web? In order to implement face recognition on the Web, you need to be familiar with related programming languages and technologies, such as JavaScript, HTML, CSS, WebRTC, etc. At the same time, you also need to master relevant computer vision and artificial intelligence technologies. It is worth noting that due to the design of the Web side

Essential tools for stock analysis: Learn the steps to draw candle charts in PHP and JS. Specific code examples are required. With the rapid development of the Internet and technology, stock trading has become one of the important ways for many investors. Stock analysis is an important part of investor decision-making, and candle charts are widely used in technical analysis. Learning how to draw candle charts using PHP and JS will provide investors with more intuitive information to help them make better decisions. A candlestick chart is a technical chart that displays stock prices in the form of candlesticks. It shows the stock price

How to use PHP and JS to create a stock candle chart. A stock candle chart is a common technical analysis graphic in the stock market. It helps investors understand stocks more intuitively by drawing data such as the opening price, closing price, highest price and lowest price of the stock. price fluctuations. This article will teach you how to create stock candle charts using PHP and JS, with specific code examples. 1. Preparation Before starting, we need to prepare the following environment: 1. A server running PHP 2. A browser that supports HTML5 and Canvas 3

Understand the meaning of HTTP 301 status code: common application scenarios of web page redirection. With the rapid development of the Internet, people's requirements for web page interaction are becoming higher and higher. In the field of web design, web page redirection is a common and important technology, implemented through the HTTP 301 status code. This article will explore the meaning of HTTP 301 status code and common application scenarios in web page redirection. HTTP301 status code refers to permanent redirect (PermanentRedirect). When the server receives the client's

HTTP Status Code 200: Explore the Meaning and Purpose of Successful Responses HTTP status codes are numeric codes used to indicate the status of a server's response. Among them, status code 200 indicates that the request has been successfully processed by the server. This article will explore the specific meaning and use of HTTP status code 200. First, let us understand the classification of HTTP status codes. Status codes are divided into five categories, namely 1xx, 2xx, 3xx, 4xx and 5xx. Among them, 2xx indicates a successful response. And 200 is the most common status code in 2xx

With the rapid development of Internet finance, stock investment has become the choice of more and more people. In stock trading, candle charts are a commonly used technical analysis method. It can show the changing trend of stock prices and help investors make more accurate decisions. This article will introduce the development skills of PHP and JS, lead readers to understand how to draw stock candle charts, and provide specific code examples. 1. Understanding Stock Candle Charts Before introducing how to draw stock candle charts, we first need to understand what a candle chart is. Candlestick charts were developed by the Japanese

The relationship between js and vue: 1. JS as the cornerstone of Web development; 2. The rise of Vue.js as a front-end framework; 3. The complementary relationship between JS and Vue; 4. The practical application of JS and Vue.

How to implement HTTP streaming in C++? Create an SSL stream socket using Boost.Asio and the asiohttps client library. Connect to the server and send an HTTP request. Receive HTTP response headers and print them. Receives the HTTP response body and prints it.
