Recall & Review
beginner
What is the purpose of the Problem Details (RFC 7807) format in REST APIs?
It provides a standardized way to return machine-readable error details in HTTP responses, making it easier for clients to understand and handle errors.
Click to reveal answer
beginner
Name the five standard fields defined in the Problem Details (RFC 7807) format.
The five standard fields are:
type, title, status, detail, and instance.Click to reveal answer
beginner
What does the
type field represent in the Problem Details format?It is a URI reference that identifies the problem type. It helps clients understand the kind of error without reading the full message.
Click to reveal answer
beginner
How should the
status field be used in the Problem Details response?It should contain the HTTP status code generated by the server for this error, such as 404 or 500.
Click to reveal answer
intermediate
Can you add custom fields to the Problem Details (RFC 7807) JSON response? If yes, how?
Yes, you can add custom fields alongside the standard ones to provide extra information specific to your API or error scenario.
Click to reveal answer
Which field in RFC 7807 contains a short, human-readable summary of the problem?
✗ Incorrect
The
title field provides a short, human-readable summary of the problem.What HTTP status code should be included in the
status field?✗ Incorrect
The
status field must contain the HTTP status code that the server returned for the error.Is the
instance field optional or required in the Problem Details format?✗ Incorrect
The
instance field is optional and can provide a URI reference that identifies the specific occurrence of the problem.What content type should be used when sending a Problem Details response?
✗ Incorrect
The official media type for Problem Details JSON responses is
application/problem+json.Can the
type field be a blank string?✗ Incorrect
The
type field should be a URI identifying the problem type or omitted if unknown; it should not be blank.Explain the purpose and main fields of the Problem Details (RFC 7807) format.
Think about how APIs tell clients what went wrong in a clear way.
You got /3 concepts.
Describe how you would implement a Problem Details response for a 404 Not Found error.
Imagine your API tells a client that a resource is missing.
You got /5 concepts.