YogeshChauhan . com

The difference between 400(4xx) and 500(5xx) errors

in Misc on 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.

amazon

Most Read

#1 How to check if radio button is checked or not using JavaScript? #2 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #3 How to add Read More Read Less Button using JavaScript? #4 How to uninstall Cocoapods from the Mac OS? #5 How to Use SQL MAX() Function with Dates? #6 PHP Login System using PDO Part 1: Create User Registration Page

Recently Posted

Jun 16 What are Stored Procedures for SQL Server? Jun 16 What are Class Constants in PHP? Jun 15 A short basic guide on states in React Jun 15 How to define constants in PHP? Jun 15 How to define visibility for a property in PHP? Jun 15 How to use @if and @else in SCSS?

You might also like these

clip and clip-path properties in CSSCSSWordPress 5.7 is migrating to latest jQuery version and people are freaking outjQueryHow to overwrite file contents with new content in PHP?PHPHow can one check to see if a remote file exists using PHP?PHPHow to get recent posts in WordPress?WordPressKilling A Project Part 1: What criteria should be used to cancel/kill a project?MiscCROSS JOIN in PostgresPostgresWhat happens when we add Numbers and Strings in JavaScript?JavaScriptThe Lending Club Analysis using Logistic Regression and Random Forest in RStudioMiscWhat is Hoisting in JavaScript?JavaScriptapply_filters function in WordPressWordPressHow to create a full screen loader using CSS and JavaScript?CSS