Bird
0
0

Which HTTP header is commonly used to indicate that a response body contains Problem Details JSON?

easy📝 Conceptual Q2 of 15
Spring Boot - Exception Handling
Which HTTP header is commonly used to indicate that a response body contains Problem Details JSON?
AAccept: application/json
BContent-Type: application/problem+json
CAuthorization: Bearer token
DCache-Control: no-cache
Step-by-Step Solution
Solution:
  1. Step 1: Identify the standard media type for Problem Details

    The Problem Details format uses the media type 'application/problem+json' to specify the error format.
  2. Step 2: Match the header with the media type

    The Content-Type header indicates the media type of the response body, so it should be 'application/problem+json'.
  3. Final Answer:

    Content-Type: application/problem+json -> Option B
  4. Quick Check:

    Problem Details media type = application/problem+json [OK]
Quick Trick: Use Content-Type with application/problem+json for error responses [OK]
Common Mistakes:
  • Confusing Accept header with Content-Type
  • Using generic application/json instead
  • Mixing authorization headers with content type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes