Bird
0
0

Identify the error in this REST API path: /users//posts/5

medium📝 Debug Q6 of 15
Rest API - URL and Resource Design
Identify the error in this REST API path: /users//posts/5
APost ID should come before user ID
BDouble slash indicates a missing user ID
CPath should end with a slash
DNo error, path is valid
Step-by-Step Solution
Solution:
  1. Step 1: Inspect the path structure

    The double slash between users and posts suggests a missing segment, likely the user ID.
  2. Step 2: Understand REST path conventions

    Each resource ID must be present; missing user ID causes invalid path.
  3. Final Answer:

    Double slash indicates a missing user ID -> Option B
  4. Quick Check:

    Double slash = missing resource ID [OK]
Quick Trick: No empty segments allowed in hierarchical paths [OK]
Common Mistakes:
MISTAKES
  • Ignoring double slashes
  • Thinking trailing slash fixes error
  • Swapping resource order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes