API Testing · Junior · Question 36 of 75
What should happen when a required field is missing from a POST body?
- 1A 4xx error that names the missing field
- 2A 500 error with a stack trace
- 3A 201 with the field saved as null
Show the answer
Correct answer: A 4xx error that names the missing field
Explanation
Clear validation messages let clients fix the request. Silently saving null leads to broken data later.