Recall & Review
beginner
What does the HTTP status code 422 Unprocessable Entity mean?
It means the server understands the request's syntax and content type, but the data is invalid or cannot be processed.
Click to reveal answer
intermediate
When should a server return 422 Unprocessable Entity instead of 400 Bad Request?
Return 422 when the request syntax is correct but the data fails validation rules or business logic.
Click to reveal answer
beginner
Give an example of a situation causing a 422 Unprocessable Entity response.
Submitting a form with a missing required field or invalid email format can cause 422.
Click to reveal answer
intermediate
How does 422 Unprocessable Entity differ from 415 Unsupported Media Type?
422 means data is invalid but format is correct; 415 means the server does not support the request's media type.
Click to reveal answer
intermediate
What is a good practice when returning 422 responses in REST APIs?
Include detailed error messages explaining which fields failed validation and why.
Click to reveal answer
What does HTTP status 422 indicate?
✗ Incorrect
422 means the server understands the request but the data cannot be processed due to validation errors.
Which status code is more appropriate for invalid JSON format?
✗ Incorrect
400 Bad Request is used when the request syntax or format is invalid, such as malformed JSON.
When should you NOT use 422 Unprocessable Entity?
✗ Incorrect
Use 415 Unsupported Media Type if the media type is unsupported, not 422.
What is a common cause for 422 responses in APIs?
✗ Incorrect
Missing or invalid fields in the request data often cause 422 responses.
What should a 422 response ideally include?
✗ Incorrect
Providing clear error messages helps clients fix the data issues causing 422.
Explain the meaning and typical use cases of the 422 Unprocessable Entity status code.
Think about request syntax vs data validity.
You got /3 concepts.
Describe best practices for handling and responding with 422 errors in REST APIs.
Focus on communication with API users.
You got /3 concepts.