Yogesh Chauhan's Blog

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

in Miscellaneous 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.


Most Read

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

Recently Posted

#Jan 17 4 advanced ways to search Colleague #Jan 16 Colleague UI Basics: The Search Area #Jan 16 Colleague UI Basics: The Context Area #Jan 16 Colleague UI Basics: Accessing the user interface #Jan 14 How to display a student’s individual transcript in Colleague? #Jan 11 How to install PuTTY on a MacOS?
You might also like these
How to create a sticky menu pin using CSS?CSSWordPress: How to loop through ACF group fields?WordPressOOP, Class and Objects Strategies For Beginners (PHP)PHPHow to create a vertically rotating texts using CSS?CSSA quick introduction to API, REST API and PostmanMiscellaneousContent Blocks in SCSS (Sass)SCSSWhat does useEffect do in React?ReactThe substr() method in JavaScript and how it’s different from substring()JavaScriptThe difference between isFinite() method and isFinite() function in JavaScriptJavaScriptHow to create rotating texts using JavaScript and CSS?CSSCheck whether a variable exists and not empty in PHPPHPA Step by Step Guide to Make RSS in XML For Any Website or Blog For FreeMiscellaneous