Bird
0
0

If a client sends this header:

medium📝 Predict Output Q5 of 15
Rest API - Versioning Strategies
If a client sends this header:
Accept: application/vnd.example.v2+json
But the server only supports v1, what is the expected behavior?
AServer returns v2 response anyway
BServer ignores version and returns v1 response
CServer returns a 406 Not Acceptable error
DServer returns 500 Internal Server Error
Step-by-Step Solution
Solution:
  1. Step 1: Understand server version support

    The client requests version 2, but server only supports version 1.
  2. Step 2: Determine correct HTTP response

    Server should respond with 406 Not Acceptable to indicate it cannot fulfill requested version.
  3. Final Answer:

    Server returns a 406 Not Acceptable error -> Option C
  4. Quick Check:

    Unsupported version request = 406 error [OK]
Quick Trick: Unsupported version request returns 406 error [OK]
Common Mistakes:
  • Assuming server silently downgrades version
  • Expecting server to return wrong version
  • Confusing 500 error with version mismatch

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes