Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • jQuery
  • AngularJS
  • ReactJS
  • Next.js
  • React Native
  • NodeJS
  • Express.js
  • MongoDB
  • MERN Stack
  • PHP
  • WordPress
  • Bootstrap
  • Tailwind
  • CSS Frameworks
  • JS Frameworks
  • Web Development
Open In App
Next Article:
Servlet - HTTP Status Codes
Next article icon

What are HTTP Status Codes ?

Last Updated : 19 May, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

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 indexed, as well as how search engines perceive the performance of your site.

Why Do We Need Many HTTP Statuses?

It reduces the complexity of client and server errors. It is also one reason why  Microservice and HATEOAS are easy to definable.

HTTP Status

HTTP Status

The initial line of the server’s response indicates the HTTP version and a three-digit status code. Server reserves some default error messages (404 not found or 500 internal server error). Each server(Tomcat, Redhat, Web server) reserves some HTTP status for inbuilt functionality. It is also possible to manually configure the status code.

HTTP Response Status Codes

  • Informational responses (100–199)
  • Successful responses (200–299)
  • Redirection messages (300–399)
  • Client error responses (400–499)
  • Server error responses (500–599)

Informational Responses

Message  Description
100 Continue readies for the client to continue with a request.
101 Switching Protocols that it will be switching to another protocol.
102 Processing (WebDAV) This code tells us that server is processing the request but at the current time, no response is available.
103 Early Hints This is to be used with the Link Header, where the preloading resources are started and the server prepares responses.

Success Response

Message  Description
200 OK For a successful transaction.
201 Created For creating an entry in the database or updating details.
202 Accepted  It might accept the request but not decided on going to create an entry.
203 Non-Authoritative Information   The information given by the user is not the original owner of the request.
204 No Content  The response came without no entity-body.
205 Reset Content  The browser should clear the form used for this transaction for additional input.
206 Partial Content  The server is returning partial data of the size requested.
207 Multi-Status (WebDAV) It has the work to convey multiple resources, in that case, where more than one code can be correct. 
208 Already Reported (WebDAV) It is used to avoid the repeating internal members of different binding to the same data. it is used inside <dav:propstat>.
226 IM Used (HTTP Data Encoding) Here, the response is represented by combining the result of one or more manipulations with the current instance.

Redirection Messages

Message  Description

300 Multiple Choices

The requested URL refers to more than one resource.

301 Moved Permanently

The requested URL is no longer used by the server. The new location for the requested document is specified in the 

Location header.  All future requests for the document should use the new URL.

302 Found 

The redirected URL is found current working URL location

303 See Other  

The requested URL can be found at a different URL (specified in the Location header) and should be retrieved by a 

GET on that resource.

304 Not Modified

The URL has not been modified since the specified date. The entity body is not sent, and the client should use its 

own local copy.

305 Use Proxy

The requested URL must be accessed through the proxy in the Location header.

307 Temporary Redirect                

The requested URL has moved, but only temporarily.

308 Permanent Redirect

It is used for locating another URL Permanently. It is done by the ‘Location:’. HTTP Response Code 301 Moved 

Permanently is similar to 308 Permanent Redirect. 

Client Error Responses

Message   Description
400 Bad Request  This response code indicates that the server detected a syntax error in the client’s request.
401 Unauthorized  The service failed because of not give proper parameters like  username, password
402 Payment Required  This code is not yet implemented in HTTP.
403 Forbidden  The request was denied for a reason the server does not want to (or has no means to) indicate to the client.
404 Not Found  The document at the specified URL does not exist.
405 Method Not Allowed 

This code is given with the Allow header and indicates that the method used by the client is not supported

for this URL.

406 Not Acceptable

The URL specified by the client exists, but not in a format preferred by the client. Along with this code, the server 

provides the Content-Language, Content-Encoding, and Content-type headers.

407 Proxy Authentication Required  The proxy server needs to authorize the request before forwarding it. Used with the Proxy-Authenticate header.
408 Request Time-out 

This response code means the client did not produce a full request within some predetermined time (usually 

specified in the server’s configuration), and the server is disconnecting the network connection.

409 Conflict 

This code indicates that the request conflicts with another request or with the server’s configuration. 

Information about the conflict should be returned in the data portion of the reply. For example, this response 

code could be given when a client’s request would cause integrity problems in a database.

410 Gone This code indicates that the requested URL no longer exists and has been permanently removed from the server.
411 Length Required The server will not accept the request without a Content-length header supplied in the request.
412 Precondition Failed  The condition specified by one or more If… headers in the request evaluated to false.
413 Request Entity Too Large  The server will not process the request because its entity-body is too large.
414 Request URL Too Long  The server will not process the request because its request URL is too large.
415 Unsupported Media Type The server will not process the request because its entity-body is in an unsupported format.
416 Request Range Not Satisfiable  The requested byte range is not available and is out of bounds.
417 Expectation Failed  The server is unable to meet the demands of the Expect header given by the client.
418 I’m a teapot It is used to attempt to refuse coffee with a teapot.
421 Misdirected Request

This request is used to direct to a server that is not able to produce any response. Generally, it is sent 

by a  server for not producing the authorities present in the request URL.

422 Unprocessable Content (WebDAV) It occurs when the request is not followed because of semantic errors.
423 Locked (WebDAV) It refers to the locked resources.
424 Failed Dependency (WebDAV) It occurs due to the failure of a recent request.
425 Too Early It occurs when a request is made that is not processed yet.
426 Upgrade Required

It refers to when the current protocol is not considered and the system is waiting so that any other 

protocol is generated. It generates the upgrade header.

428 Precondition Required This request comes when the request is conditional. This is used to help with the lost update problem.
429 Too Many Requests This error comes when multiple requests are made in a certain amount of time.
431 Request Header Fields Too Large This comes when header fields are large enough to proceed. This request comes in that condition.
451 Unavailable for Legal Reasons

It occurs when any request is not fulfilled because of some legal reasons, it can be due to a web 

page being censored.

Server Error Responses

Message Description
500 Internal Server Error This code indicates that a part of the server encountered a configuration error.
501 Not Implemented  This code indicates that the client requested an action that cannot be performed by the server.
502 Bad Gateway  This code indicates that the server (or proxy) encountered invalid responses from another server (or proxy).
503 Service Unavailable  This code means that the service is temporarily unavailable, but should be restored in the future.
504 Gateway Time-out This code means that the service is temporarily unavailable, but should be restored in the future.
505 HTTP Version Not Supported Internet Engineering Task Force (IETF) Publish information usage of standard code.
506 Variant Also Negotiates

It comes with a configuration error. It is engaged in negotiation., but does not exist at

the endpoint of the negotiation process.

507 Insufficient Storage (WebDAV) It comes when the request is not to be completed because of the proper storage.
508 Loop Detected This error comes when there is an infinite loop.
510 Not Extended Some more extensions are required for the server for fulfilling it.
511 Network Authentication Required This indicates that it requires verifying network access.


Next Article
Servlet - HTTP Status Codes

L

logesh710
Improve
Article Tags :
  • Web Technologies

Similar Reads

  • 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
    3 min read
  • JSP - HTTP Status Codes
    When the Client makes any requests to the server, the Status Codes are issued by the server as a response to the client's request. So, in an application, we have the client and the server architecture. The server is the part that holds the particular web service or an API. The client is the actor wh
    4 min read
  • Servlet - HTTP Status Codes
    For each HTTP request and HTTP response, we have messages. The format of the HTTP request and HTTP response messages are similar and will have the following structure − An initial status line + CRLFCRLF =  ( Carriage Return + Line Feed i.e. New Line )Zero or more header lines + CRLFA blank line, i.e
    5 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-
    3 min read
  • 10 Most Common HTTP Status Codes
    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 wit
    5 min read
  • HTTP headers | Accept-Patch
    The Patch is used for making partial changes to an existing resource. The Accept-Patch HTTP header is a response HTTP header that specifies the patch document is supported or not and also the media type that the server is able to understand. The presence of a specific patch document format in this h
    1 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. Information
    4 min read
  • What is HTTP ?
    HTTP (Hypertext Transfer Protocol) is a fundamental protocol of the Internet, enabling the transfer of data between a client and a server. It is the foundation of data communication for the World Wide Web. HTTP provides a standard between a web browser and a web server to establish communication. It
    5 min read
  • HTTP Headers - User-Agent
    The HTTP header User-Agent is a request header that sends a characteristic string to web servers, allowing them to identify the Operating System (OS) and browser of the client making the request. Every time your browser connects to a website, it includes the User-Agent field in the HTTP header. This
    2 min read
  • 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) S
    4 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences