Bird
0
0

A client sends this Accept header:

hard📝 Application Q9 of 15
Rest API - Versioning Strategies
A client sends this Accept header:
Accept: application/vnd.example.v1+json, application/vnd.example.v2+json;q=0.8
Which API version will the server prioritize?
AVersion 1
BVersion 2
CBoth versions equally
DDefault version without media type
Step-by-Step Solution
Solution:
  1. Step 1: Understand quality values (q)

    The 'q' parameter indicates preference; higher q means higher priority.
  2. Step 2: Compare q values

    Version 1 has no q (defaults to 1), version 2 has q=0.8, so version 1 is preferred.
  3. Final Answer:

    Version 1 -> Option A
  4. Quick Check:

    Higher q value means higher priority [OK]
Quick Trick: No q means highest priority in Accept header [OK]
Common Mistakes:
  • Ignoring q values in Accept header
  • Assuming last version listed is preferred
  • Thinking q=0.8 is higher than default

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes