YogeshChauhan.com
The difference between 400(4xx) and 500(5xx) errors
February 23, 2020

The main difference between the two is whose fault that error is. A 4xx code indicates an error caused by the user, whereas 5xx codes tell the client that they did everything correctly and it’s the server itself who caused the problem.

When should we return 4xx or 5xx status codes to the client?

4xx codes are used to tell the client that a fault has taken place on THEIR side. They should not retransmit the same request again, but fix the error first.

5xx codes tell the client something happened on the server and their request by itself was perfectly valid. The client can continue and try again with the request without modification.

dreamhost

Leave a Reply

Most Read

#1 How to check if radio button is checked or not using JavaScript? #2 How to set opacity or transparency using CSS? #3 Pagination in CSS with multiple examples #4 How to make HTML form interactive and using CSS? #5 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #6 How to uninstall Cocoapods from the Mac OS?

Recently Posted

Mar 3 How to embed YouTube or other video links in WordPress? Mar 3 How to change the Login Logo in WordPress? Mar 3 substring() Method in JavaScript Mar 3 Window setInterval() Method in JavaScript Mar 2 How to zoom an element on hover using CSS? Mar 2 the box-sizing property in CSS

You might also like these

Some interesting HTML Input Attributes to rememberHTMLHow to link/add CSS file to HTML Document?CSSContent types in DrupalDrupalHow to read Standard Input in Swift?SwiftHow JavaScript classes allows us to do less typing (syntactic sugar)?JavaScriptCan we execute conditions in SQL?SQL/MySQLHow to Sort (Shuffle) an Array in Random Order in JavaScript?JavaScriptHow to Write Complex Search Queries in SQL?SQL/MySQLHow to remove N/A from Radio Button list in Drupal?DrupalA Quick Guide to Object-Oriented Programming in PHPPHPHow to Use Aggregate Functions (MIN, MAX, SUM, AVG, COUNT) to Summarize Data in SQL?SQL/MySQLList of social media icon logo color codes in HEXMisc