Bird
0
0

A client sends an Accept header with media types not supported by the server. What HTTP status code is the server expected to return?

medium📝 Debug Q6 of 15
Rest API - Request and Response Format
A client sends an Accept header with media types not supported by the server. What HTTP status code is the server expected to return?
A406 Not Acceptable
B404 Not Found
C401 Unauthorized
D500 Internal Server Error
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the Accept header

    The client requests media types that the server cannot provide.
  2. Step 2: Identify the correct HTTP status code

    According to HTTP standards, the server should respond with 406 Not Acceptable when it cannot fulfill the requested content types.
  3. Final Answer:

    406 Not Acceptable -> Option A
  4. Quick Check:

    406 means no acceptable content type found. [OK]
Quick Trick: 406 means server can't provide requested content type [OK]
Common Mistakes:
MISTAKES
  • Confusing 406 with 404 (resource not found)
  • Using 401 which is for authentication
  • Assuming 500 for content negotiation errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes