Bird
0
0

Which of the following is the correct URI format for accessing a single resource named 'book' with ID 45?

easy📝 Syntax Q3 of 15
Rest API - REST API Fundamentals
Which of the following is the correct URI format for accessing a single resource named 'book' with ID 45?
A/books/get/45
B/books?id=45
C/book/45/details
D/books/45
Step-by-Step Solution
Solution:
  1. Step 1: Identify standard REST URI pattern

    Accessing a single resource uses the collection name plus resource ID, like /books/45.
  2. Step 2: Compare options

    /books/45 matches the standard. /books?id=45 uses query parameters, less common for single resource. Options C and D add unnecessary segments.
  3. Final Answer:

    /books/45 -> Option D
  4. Quick Check:

    Single resource URI = /collection/id [OK]
Quick Trick: Use /resourceName/id for single resource access [OK]
Common Mistakes:
  • Using query parameters for resource ID
  • Adding extra path segments unnecessarily
  • Confusing plural and singular resource names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes