Bird
0
0

You want to support two API versions simultaneously using media type versioning. Which server behavior best supports this?

hard📝 Application Q15 of 15
Rest API - Versioning Strategies
You want to support two API versions simultaneously using media type versioning. Which server behavior best supports this?
AParse the Accept header and return data matching the requested version
BIgnore Accept header and always return version 2 data
CUse URL path versioning instead of media type versioning
DReturn an error if Accept header version is not latest
Step-by-Step Solution
Solution:
  1. Step 1: Understand requirement for simultaneous version support

    To support multiple versions, the server must detect which version the client wants.
  2. Step 2: Identify correct server behavior

    Parsing the Accept header and returning matching version data allows backward compatibility and coexistence.
  3. Final Answer:

    Parse the Accept header and return data matching the requested version -> Option A
  4. Quick Check:

    Server parses Accept header to serve requested version [OK]
Quick Trick: Server must read Accept header to serve correct version [OK]
Common Mistakes:
  • Ignoring Accept header and forcing one version
  • Switching to URL versioning instead of media type
  • Returning errors instead of supporting old versions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes