Home Web Front-end Front-end Q&A What are HTTP status codes

What are HTTP status codes

Dec 21, 2018 pm 05:29 PM
404 http status code

HTTP status code is a three-digit integer code used to indicate whether a specific HTTP request has been successfully completed, indicating the HTTP response status; the first number of the code defines the type of server response, and the following two numbers have no classification. .

What are HTTP status codes

Types of HTTP status codes

HTTP status codes can be divided into five categories, consisting of The first digit of the status code represents the different categories:

1xx Class: Information

1xx class code indicates that the request has been received and the process is continuing. If HTTP status code 1xx is sent, the server notifies the client that the request is in motion. This class combines the code responsible for delivering information to the client during a request.

2xx class: Success

2xx class code indicates that the client's request has been successfully received and run. If this code is transmitted, it means that the client's request has been received, understood, and accepted by the server. It is usually sent at the same time as the desired website information, and users usually only pay attention to the website they requested.

3xx class: Redirect

3xx class code indicates that a request from the server has been received, but in order to ensure that the request is successfully processed, further steps are required from the client. 3xx codes will appear during redirection and forwarding.

4xx Class: Client Error

4xx class code indicates that the request contains incorrect syntax or that the request cannot be fulfilled, that is, there is a client error. The server received the request but was unable to execute it. Internet users will be aware of this error by receiving automatically generated HTML pages.

5xx class: Server error

4xx class code indicates that the server has an error or abnormal state during the process of processing the request, causing the server to be unable to execute the request. . These server error codes report that the request cannot be performed currently or at all, which results in an HTML error page.

Top 10 HTTP status codes

200: OK

What are HTTP status codes

indicates that the request was successful. The meaning of success depends on the HTTP method:

GET method: Indicates that the resource has been obtained and transmitted in the message body.

HEAD method: Indicates that the entity header is located in the message body.

PUT or POST method: Indicates that the resource describing the operation result is transmitted in the message body.

TRACE method: Indicates that the message body contains the request message received by the server

201: Create

Indicates that the request was successful and a new resource was created . This is usually a response sent after a POST request or after some PUT request.

204: No content

Indicates that the request has been successfully processed, but no content body was returned.

304: Unmodified

It tells the client that the response has not been modified, so the client can continue to use the same cached version of the response.

400: Bad Request

400 is a generic client error status, used when no other 4xx error codes apply. Errors may resemble malformed request syntax, invalid request message parameters, or deceptive request routing, etc. It means that the server cannot understand the request due to invalid syntax.

401: Unauthorized

The 401 error response indicates that the client is trying to run on a protected resource without providing appropriate authorization. It may have provided incorrect credentials. Or not at all. Semantically it means "unauthenticated". That is, the client must authenticate itself to get a response to the request.

403: Forbidden

The 403 error response indicates that the client's request was correctly formed, but the REST API refused to recognize it, i.e. the user does not have the necessary permissions to the resource (without authorization), so the server refuses to provide an appropriate response. Unlike 401, the server knows the client's identity.

404: Not Found

What are HTTP status codes

The server cannot find the requested resource. In the browser, this means that the REST API cannot map the client's URI to the resource, but it may be available in the future; it also means that the endpoint may be valid but the resource itself does not exist.

404 is probably the most famous error status code because it appears so often on the web.

500: Internal Server Error

500 is a generic REST API error response and is a collected status code that should be applied to unexpected server errors. This HTTP status code is automatically issued if an error occurs on the server side (which prevents retrieval of the requested data).

504: Gateway Timeout

This error response is given when the server is acting as a gateway and cannot get a response in time.

Summary: The above is the entire content of this article, I hope it will be helpful to everyone's study.

The above is the detailed content of What are HTTP status codes. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

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 Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1676
14
PHP Tutorial
1278
29
C# Tutorial
1257
24
What does http status code 520 mean? What does http status code 520 mean? Oct 13, 2023 pm 03:11 PM

HTTP status code 520 means that the server encountered an unknown error while processing the request and cannot provide more specific information. Used to indicate that an unknown error occurred when the server was processing the request, which may be caused by server configuration problems, network problems, or other unknown reasons. This is usually caused by server configuration issues, network issues, server overload, or coding errors. If you encounter a status code 520 error, it is best to contact the website administrator or technical support team for more information and assistance.

What is http status code 403? What is http status code 403? Oct 07, 2023 pm 02:04 PM

HTTP status code 403 means that the server rejected the client's request. The solution to http status code 403 is: 1. Check the authentication credentials. If the server requires authentication, ensure that the correct credentials are provided; 2. Check the IP address restrictions. If the server has restricted the IP address, ensure that the client's IP address is restricted. Whitelisted or not blacklisted; 3. Check the file permission settings. If the 403 status code is related to the permission settings of the file or directory, ensure that the client has sufficient permissions to access these files or directories, etc.

Understand common application scenarios of web page redirection and understand the HTTP 301 status code Understand common application scenarios of web page redirection and understand the HTTP 301 status code Feb 18, 2024 pm 08:41 PM

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 200 OK: Understand the meaning and purpose of a successful response HTTP 200 OK: Understand the meaning and purpose of a successful response Dec 26, 2023 am 10:25 AM

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

How to use Nginx Proxy Manager to implement automatic jump from HTTP to HTTPS How to use Nginx Proxy Manager to implement automatic jump from HTTP to HTTPS Sep 26, 2023 am 11:19 AM

How to use NginxProxyManager to implement automatic jump from HTTP to HTTPS. With the development of the Internet, more and more websites are beginning to use the HTTPS protocol to encrypt data transmission to improve data security and user privacy protection. Since the HTTPS protocol requires the support of an SSL certificate, certain technical support is required when deploying the HTTPS protocol. Nginx is a powerful and commonly used HTTP server and reverse proxy server, and NginxProxy

Send POST request with form data using http.PostForm function Send POST request with form data using http.PostForm function Jul 25, 2023 pm 10:51 PM

Use the http.PostForm function to send a POST request with form data. In the http package of the Go language, you can use the http.PostForm function to send a POST request with form data. The prototype of the http.PostForm function is as follows: funcPostForm(urlstring,dataurl.Values)(resp*http.Response,errerror)where, u

Quick Application: Practical Development Case Analysis of PHP Asynchronous HTTP Download of Multiple Files Quick Application: Practical Development Case Analysis of PHP Asynchronous HTTP Download of Multiple Files Sep 12, 2023 pm 01:15 PM

Quick Application: Practical Development Case Analysis of PHP Asynchronous HTTP Download of Multiple Files With the development of the Internet, the file download function has become one of the basic needs of many websites and applications. For scenarios where multiple files need to be downloaded at the same time, the traditional synchronous download method is often inefficient and time-consuming. For this reason, using PHP to download multiple files asynchronously over HTTP has become an increasingly common solution. This article will analyze in detail how to use PHP asynchronous HTTP through an actual development case.

http request 415 error solution http request 415 error solution Nov 14, 2023 am 10:49 AM

Solution: 1. Check the Content-Type in the request header; 2. Check the data format in the request body; 3. Use the appropriate encoding format; 4. Use the appropriate request method; 5. Check the server-side support.

See all articles