API Testing · Junior · Question 10 of 75
A request with an invalid email returns 500. What is the problem?
- 1Nothing, because 500 is the correct code for bad input
- 2Validation errors should be 4xx; a 500 means unhandled input
- 3The client must retry the request until it succeeds
Show the answer
Correct answer: Validation errors should be 4xx; a 500 means unhandled input
Explanation
Bad input is the client's fault and should return 400 or 422 with a clear message. A 500 usually means an exception wasn't caught.