Bird
0
0

Which of the following is the correct way to request version 2 of an API using query parameter versioning?

easy📝 Syntax Q12 of 15
Rest API - Versioning Strategies
Which of the following is the correct way to request version 2 of an API using query parameter versioning?
AGET /api/resource/version=2
BGET /api/version/2/resource
CGET /api/resource?version=2
DGET /api/resource#version=2
Step-by-Step Solution
Solution:
  1. Step 1: Recall query parameter syntax in URLs

    Query parameters come after a question mark ? and use key=value pairs, e.g., ?version=2.
  2. Step 2: Match the correct syntax for versioning

    The correct way to specify version 2 is by adding ?version=2 after the resource path.
  3. Final Answer:

    GET /api/resource?version=2 -> Option C
  4. Quick Check:

    Query param syntax = ?key=value [OK]
Quick Trick: Query parameters start with ? and use key=value [OK]
Common Mistakes:
  • Using slashes instead of query parameters
  • Using # instead of ? for query parameters
  • Placing version inside the URL path incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes