Sobes.tech
Junior

What is the difference between status codes 400 and 500?

sobes.tech AI

Answer from AI

The 400 (Bad Request) status code indicates that the server cannot process the request due to a client-side error.

Examples:

  • Incorrect request syntax.
  • Missing required parameters.
  • Data in an incorrect format.

The 500 (Internal Server Error) status code indicates that the server encountered an unexpected error that prevented it from fulfilling the request.

Examples:

  • Database connection error.
  • Error executing server-side code.
  • Internal application failures.
Code Description Cause Who is at fault?
400 Bad Request Client error in request Client
500 Internal Server Error Server-side execution error Server