Bird
0
0

You want to design an API versioning strategy that allows clients to specify the version either in the URL path or in a custom header. Which approach best follows versioning best practices?

hard📝 Application Q15 of 15
Rest API - Versioning Strategies
You want to design an API versioning strategy that allows clients to specify the version either in the URL path or in a custom header. Which approach best follows versioning best practices?
AIgnore versioning and always use the latest API version
BSupport both methods but clearly document and prefer one as primary
CAllow clients to mix URL and header versions freely without restrictions
DUse query parameters for versioning only
Step-by-Step Solution
Solution:
  1. Step 1: Understand consistency in versioning

    Best practice is to be consistent and clear about versioning methods.
  2. Step 2: Choose a primary versioning method

    Supporting both but preferring one and documenting it helps developers avoid confusion.
  3. Final Answer:

    Support both methods but clearly document and prefer one as primary -> Option B
  4. Quick Check:

    Clear, consistent versioning = best practice [OK]
Quick Trick: Pick one versioning method as main, document it well [OK]
Common Mistakes:
  • Mixing versions without clear rules
  • Ignoring versioning and breaking clients
  • Using only query parameters without reason

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes