Bird
0
0

A developer wrote the URL /users//123/orders to get orders for user 123. What is the problem with this URL?

medium📝 Debug Q14 of 15
Rest API - URL and Resource Design
A developer wrote the URL /users//123/orders to get orders for user 123. What is the problem with this URL?
AThe URL is missing a query parameter.
BUser ID should come after orders, not before.
COrders should be capitalized in the URL.
DDouble slashes cause incorrect URL structure and may lead to errors.
Step-by-Step Solution
Solution:
  1. Step 1: Examine the URL structure

    The URL has two slashes between 'users' and '123', which is not standard and can cause parsing issues.
  2. Step 2: Evaluate the impact

    Double slashes can confuse servers or clients, leading to errors or unexpected behavior.
  3. Final Answer:

    Double slashes cause incorrect URL structure and may lead to errors. -> Option D
  4. Quick Check:

    Extra slashes break URL format = D [OK]
Quick Trick: Avoid double slashes in URLs [OK]
Common Mistakes:
  • Ignoring extra slashes
  • Thinking order of ID and resource is wrong here
  • Believing capitalization matters in URLs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes