Bird
0
0

Which of the following is the correct syntax for a GET request URL to fetch a resource with ID 10?

easy📝 Syntax Q3 of 15
Rest API - HTTP Methods
Which of the following is the correct syntax for a GET request URL to fetch a resource with ID 10?
A/items/ID=10
B/items?10
C/items/10
D/items#10
Step-by-Step Solution
Solution:
  1. Step 1: Understand REST URL patterns

    Resource IDs are usually part of the path, e.g., /items/10.
  2. Step 2: Identify correct URL format

    /items/10 correctly specifies the resource ID in the path.
  3. Final Answer:

    /items/10 -> Option C
  4. Quick Check:

    GET URL with ID = /items/10 [OK]
Quick Trick: Use /resource/{id} to get specific item [OK]
Common Mistakes:
  • Using query or fragment incorrectly
  • Adding ID= in path
  • Misplacing ID in URL

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes