The Wayback Machine - https://web.archive.org/web/20240920125808/https://www.geeksforgeeks.org/10-most-common-http-status-codes/
Open In App

10 Most Common HTTP Status Codes

Last Updated : 20 Oct, 2022
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

You search for anything on Google, and by this, a request is being sent to the server, then the server responds. This response is done using HTTP (HyperText Transfer Protocol) by the server. There can be two cases – the server may respond with the information it has, or else it may show an error with a code. Whenever there’s an error in the back end, the server responds with an error code that explains what error could have happened.

10-Most-Common-HTTP-Status-Codes

The HTTP status code is a response made by the server to the client’s request. These are three-digit codes, while there are more than 60 error status codes, we’ll go through some of the major HTTP status codes which are printed generally.

Let’s discuss status codes with their meanings:

  • 1xx – Informational Response (These status codes are all about the information received by the server when a request is made).
  • 2xx – Success (This status code depicts that the request made has been fulfilled by the server and the expected response has been achieved).
  • 3xx – Redirection (The requested URL is redirected elsewhere).
  • 4xx – Client Errors (This indicates that the page is not found).
  • 5xx – Server Errors (A request made by the client but the server fails to complete the request). 

Let’s go through some Major HTTP Status Codes:

1. 200  (Success/OK)

The HTTP status code 200 represents success which means the page you have requested has been fetched. The action made has been accepted and has been delivered to the client by delivering the requested page. 

  • GET: entity in reference to the requested source sent to the response
  • POST: entity describing the response of action made
  • HEAD: an entity-header field similar to the requested source 
  • TRACE: a request made by the client is taken care of by the server

2. 301 (Permanent Redirect)

The HTTP status code 301 means that the page you have requested has moved to a new URL and which is permanent. In the future, whenever the user requests the same website, it will be redirected to the new URL. The modified permanent URL is given by the location filed in response. 

3. 302 (Temporary Redirect)

The requested URL has been redirected to another website which is temporary. Major changes in the URL will be in the future. Other than GET or HEAD, if the 302 is received in response to a request. The redirection is temporarily redirected to another website. 

4. 304 (Not Modified)

HTTP status code 304 is used for caching purposes. The response has not been changed so that in the future the client can resume the same cache. If there’s a GET request and access is allowed, but the document has not been modified. The response MUST NOT contain a message-body and therefore comes to an end by the first empty line. 

5. 400 (Bad Request)

When the client requests a page and the server is not able to understand anything, it displays a 400 HTTP status code. The client SHOULD NOT repeat the request without any changes. The request can be a malformed, deceptive request routing, or invalid request.

6. 401 (Unauthorized Error)

This HTTP status code requires user authentication. The response includes the WWW-Authenticate header field containing a challenge applied to a requested source. HTTP access authentication “HTTP Authentication: Basic and Digest Access Authentication”.

7. 403 (Forbidden)

The HTTP status code 403 implies that the request is understood by the server, but still refuses to fulfill it. If the request method was not HEAD and also the server wants to make it public when the request is not completed, it SHOULD tell the reason for the refusal in the entity. 

8. 404 (Not Found)

404 HTTP Status code appears when you request a URL and then the server has not found anything. This happens when the server doesn’t wish to describe the reason why the request has been refused. Also, the server is not able to find a representation for the target resource. 

9. 500 (Internal Server Error)

500 HTTP status code means requesting a URL is not fulfilled because the server encounters an unexpected condition. It gives information about the request made if it is successful, and throws an error. When there’s an error during a connection to the server, and the requested page cannot be accessed then this message is displayed. 

10. 501 (Not Implemented)

When a request is made by the client, the server is not able to recognize the request method and is not able to support any resource. By default. it is cacheable. The methods, the server requires to support are GET and HEAD. The server does not support the functionality required to fulfill the request. 

Other HTTP Status Codes Are:

100 Continue 

101 Switching Protocol 

102 Processing (WebDAV) 

103 Early Hints 

200 OK 

201 Created 

202 Accepted 

203 Non-Authoritative Information 

204 No Content 

205 Reset Content 

206 Partial Content 

207 Multi-Status (WebDAV) 

208 Already Reported (WebDAV)

226 IM Used (HTTP Delta encoding) 

300 Multiple Choice

301 Moved Permanently 

302 Found

303 See Other

304 Not Modified 

305 Use Proxy 

306 Unused 

307 Temporary Redirect 

308 Permanent Redirect 

400 Bad Request 

401 Unauthorized 

402 Payment Required 

403 Forbidden 

404 Not Found 

405 Method Not Allowed

406 Not Acceptable 

407 Proxy Authentication Required

408 Request Timeout

409 Conflict 

410 Gone

411 Length Required 

412 Precondition Failed 

413 Payload Too Large 

414 URI Too Long 

415 Unsupported Media Type 

416 Range Not Satisfiable 

417 Expectation Failed 

418 I’m a teapot

421 Misdirected Request

425 Too Early 

426 Upgrade Required 

428 Precondition Required

429 Too Many Requests 

431 Request Header Fields Too Large

451 Unavailable For Legal Reasons 

500 Internal Server Error 

501 Not Implemented 

502 Bad Gateway

503 Service Unavailable 

504 Gateway Timeout 

505 HTTP Version Not Supported 

506 Variant Also Negotiates 

507 Insufficient Storage (WebDAV)

508 Loop Detected (WebDAV) 

510 Not Extended 

511 Network Authentication Required



Similar Reads

HTTP status codes | Successful Responses
The HTTP status codes are used to indicate that any specific HTTP request has successfully completed or not. The HTTP status codes are categorized into five sections those are listed below: Informational responses (100–199) Successful responses (200–299) Redirects (300–399) Client errors (400–499) Server errors (500–599) There are ten Successful Re
4 min read
HTTP status codes | Informational Responses
The HTTP status codes are used to indicate that any specific HTTP request has successfully completed or not. The HTTP status codes are categorized into five sections those are listed below: Informational responses (100–199) Successful responses (200–299) Redirects (300–399) Client errors (400–499) Server errors (500–599) There are four Informationa
2 min read
HTTP status codes | Redirection Responses
HTTP status codes are a conversation between your browser and the site server. The server gives responses to the browser's request in the form of a three-digit code known as HTTP status codes. The HTTP status codes are categorized into five sections which are listed below. Informational responses (100–199) Successful responses (200–299) Redirects (
2 min read
HTTP status codes | Server Error Responses
HTTP status codes is a conversation between your browser and the site server. The server gives responses to the browser's request in the form of a three-digit code known as HTTP status codes. Categories of HTTP status codes are. Informational responses (100–199) Successful responses (200–299) Redirects (300–399) Client errors (400–499) Server error
3 min read
HTTP status codes | Client Error Responses
The browser and the site server have a conversation in the form of HTTP status codes. The server gives responses to the browser’s request in the form of a three-digit code known as HTTP status codes. The categorization of HTTP status codes is done in five sections which are listed below. Informational responses (100–199)Successful responses (200–29
4 min read
What do you understand by the HTTP Status Codes ?
The HTTP or the HyperText Transfer Protocol is a protocol of the application layer. It helps in establishing communication between a web browser and a web server. When a client requests any information, the browser sends a response using numeric status codes. These status codes are in the form of 3-digit numbers ranging from 100 - 599. The client t
3 min read
What are HTTP Status Codes ?
HTTP Protocol is used everywhere from the server page to each service communication, deploying service to monitoring service. HTTP codes give an extension of HTTP protocol to debug network problems using curl, telnet able to check server availability, service responses HTTP status code is used for search engine optimization of how your pages get in
8 min read
Which HTTP response status codes result in then() and which in catch() ?
Axios is a popular JavaScript library for making HTTP requests. It uses promises to handle the response from the server, and provides a convenient then() and catch() syntax for working with the data or handling errors. Have you ever wondered which HTTP response status codes will cause axios to call the then() callback, and which will cause it to ca
4 min read
How To Troubleshoot Common HTTP Error Codes ?
It has happened to almost everyone many times that when we want to access any website, some coded message shows up on the screen indicating that we can’t access the website. These codes with error message are basically called as HTTP error code. HTTP (HyperText Transfer Protocol) is a process through which the client interacts with the server. When
9 min read
HTTP 201 status code
What is HTTP ? HTTP stands for Hyper Text Transfer Protocol. Using this protocols, the clients communicate with server and vice versa. This concept is the core of internet, since it was created in 1990. HTTP is basic yet powerful file transfer protocol. Features of HTTP: HTTP is connectionless: This means that HTTP needs a continuous connection wit
3 min read
Can you console all HTTP status code in Node.js ?
NodeJS is a runtime environment built to run Javascript outside the browser. It is widely used to build servers at the backend, which interact with the frontend such as websites, mobile applications, and many more. In this article, We will check whether we can console all HTTP status codes in NodeJS. To understand this problem, we first need to und
3 min read
What is 412 Precondition Failed - HTTP Status Code Glossary
The internet thrives on communication between servers and clients, with HTTP status codes acting as a vital language for conveying success or failure. Among these codes, the 412 Precondition Failed message can be a source of confusion for both users and developers. This article delves into the details and fixing methods of the 412 status code, expl
8 min read
Express: Specify HTTP status code when throwing error in service
In express, we can use res.status(--statusCode--) to set the status code. Let's create a simple web application using express and create a blog route, and when the user tries to access that route it will send the status code. Syntax: res.status(--statusCode--);where you have to change the --statusCode-- to the code you want to set. Creating Applica
3 min read
Why are HTTP cookies used by Node.js for sending and receiving HTTP cookies?
The HTTP protocol is one of the most important protocols of the Application layer of the OSI model. The main use of this protocol is for sending hypertext information to the client to the server and server to the client to communicate on the World Wide Web. But, the HTTP protocol is a stateless protocol which means that this protocol cannot maintai
5 min read
Difference between HTTP/2 and HTTP/1.1
HTTP stands for hypertext transfer protocol & it is used in client-server communication. By using HTTP user sends the request to the server & the server sends the response to the user. There are several stages of development of HTTP but we will focus mainly on HTTP/1.1 which was created in 1997 & the new one is HTTP/2 which was created
3 min read
Will the 'error' event ever be emitted on 'http.IncomingMessage' in a node.js http.request ?
In this article, we will see how to handle the 'error' event that is emitted on 'http.IncomingMessage' in a node.js http.request. In Node.js, the 'http.IncomingMessage' object is used to represent the incoming HTTP request message. This object is a readable stream, and it can emit various events such as 'data', 'end', and 'error'. One of the events
3 min read
Reading QR codes using Node.js
When we are working with Node.js to build any application, we might want our apps to interact with external apps or payment gateways that provide QR codes to communicate the information. In this article, we will see how we can decode a QR code in our node.js applications. Let's set up our workspace by executing these commands: Creating directory: n
2 min read
How to generate QR Codes with Angular 10 ?
QR Code (Quick Response Code) has become the essential component for each and every product, organization, app, etc. In marketing campaigns, we can use the generated QR code to Download appsSend EmailView business location etc. In this article let us see how to generate QR Codes with Angular 10. Prerequisites: In your local development machine Node
3 min read
How can JavaScript codes be hidden from old browsers that do not support JavaScript ?
Nowadays all modern browsers support JavaScript, however, older browsers did not support JavaScript. In this article, we will learn how we can hide JavaScript code from running in older browsers. Approach: After opening the <script> tag, we will use a one-line HTML style comment without any closing character ( <!-- ). We will then write th
2 min read
Node.js Exit Codes
Node.js is a cross-platform, open-source back-end JavaScript runtime environment that uses the V8 engine to execute JavaScript code outside of a web browser. Node.js allows developers to utilize JavaScript to create command-line tools and server-side scripting, which involves running scripts on the server before sending the page to the user's brows
3 min read
JavaScript Program to Generate n-bit Gray Codes
In this article, we are going to learn about Generate n-bit Gray Codes in JavaScript.Generating n-bit Gray Codes in JavaScript means creating a sequence of binary numbers of length n where each adjacent number differs by only one bit, typically starting with 0 and 1. There are several methods that can be used to Generate n-bit Gray Codes in JavaScr
3 min read
JavaScript Program to Generate Random Hex Codes of Color
What is hex code? A hex code is a six-digit, three-byte hexadecimal number used to represent colors in HTML, CSS, and SVG. The bytes represent the red, green, and blue components of the color. The hex codes are an integral part of HTML for web design and are a key way of representing colors digitally. Methods to be used for generating hex codes: Ma
1 min read
Reading and Generating QR codes in Python using QRtools
This article aims to introduce the use of the python library: qrtools. This library can be used to both read QR codes and generate them. What are QR codes? QR code, or quick response code, is a trademark for a type of 2 dimensional barcode. 2 dimensional barcodes are similar to one dimensional barcodes, but can store more information per unit area.
5 min read
HTML Color Codes
HTML Color Codes is a complete library of all Colors that can be used in HTML with their color name, HEXA Code, RGB Code, and HSL Code. With HTML Color Codes, you can easily integrate these colors directly into your HTML or CSS code, enhancing the visual appeal of your website. table{ display: inline-table !important; width: 100% !important; } Did
11 min read
Push Codes from Linux (UBUNTU) To GitHub using SSH KEY
GitHub, one of the most popular platforms for version control and collaboration, offers multiple authentication methods for interacting with repositories. SSH keys provide a secure and convenient way to authenticate and push code from a local machine to GitHub. In this article, we'll learn the step-by-step process of pushing code from Linux (Ubuntu
3 min read
HTML Hex Color Codes
HEX color codes are a fundamental aspect of web design, allowing developers to specify colors in HTML and CSS with precision. These codes consist of a hash symbol (#) followed by six characters, each representing the intensity of the primary colors: red, green, and blue (RGB) in hexadecimal format. The format for a HEX color code is #RRGGBB , where
5 min read
HTML | DOM Window status Property
The Window status property in HTML DOM is used to set or return the text in the status bar at the bottom of the browser. Syntax: window.status Note: This property has been DEPRECATED and is no longer recommended. Return Value: It returns a string which represents the text displayed in the status bar. Example 1: This example use window status proper
2 min read
Role of Technology in Changing Business Status
Technical advancements have reshaped the life of the people. Whether someone wants to buy a new smartphone or interested in buying the latest car model, it can be possible with current technology. Technology has improved the working conditions for every industry. The kind of obstacles used to be previously faced by businesses has been resolved easi
5 min read
How to create Covid19 Country wise status project using REST API ?
Today, All Countries in the world fighting with Coronavirus. Every day, Coronavirus cases rising rapidly. It is important for all to keep track of COVID Cases daily and should try to keep himself/herself safe. We have made small web apps that will tell you the total no of cases, new cases, new death, recovery, etc. to the user. You have to just ent
7 min read
ASP Status Property
The ASP Status Property is used to specify the value of the status of the asp page which is returned by the user. This Property is also used to change the status of the asp page. Syntax: response.Status=statusdescription Parameter Values: This property accepts a single value as mentioned above and described below: statusdescription: It represents a
1 min read
Article Tags :