Bird
0
0

Given the URL /orders/789/items and a GET request, what is the expected result?

medium📝 Predict Output Q4 of 15
Rest API - URL and Resource Design
Given the URL /orders/789/items and a GET request, what is the expected result?
ACreate a new item in order 789
BDetails of order 789
CDelete order 789
DList of items in order 789
Step-by-Step Solution
Solution:
  1. Step 1: Understand URL and HTTP method

    The URL points to 'items' under order '789', and GET means retrieve data.
  2. Step 2: Match URL meaning with action

    So it should return the list of items inside order 789, not order details or modifications.
  3. Final Answer:

    List of items in order 789 -> Option D
  4. Quick Check:

    GET + nested resource = list retrieval [OK]
Quick Trick: GET retrieves resource data, not changes it [OK]
Common Mistakes:
  • Confusing GET with POST or DELETE
  • Ignoring nested resource meaning
  • Assuming URL triggers creation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes