Bird
0
0

Given the following API endpoints, which one correctly retrieves a list of orders?

medium📝 Predict Output Q13 of 15
Rest API - URL and Resource Design
Given the following API endpoints, which one correctly retrieves a list of orders?
GET /order
GET /orders
GET /order/456
GET /orders/456
AGET /order
BGET /orders/456
CGET /orders
DGET /order/456
Step-by-Step Solution
Solution:
  1. Step 1: Identify endpoints returning lists

    Endpoints returning lists should use plural resource names without an ID.
  2. Step 2: Analyze each option

    GET /orders uses plural and no ID, so it returns the list of orders. Others either use singular or include an ID, indicating single item access.
  3. Final Answer:

    GET /orders -> Option C
  4. Quick Check:

    List retrieval = plural resource without ID [OK]
Quick Trick: Plural + no ID means list retrieval [OK]
Common Mistakes:
  • Choosing singular endpoint for list
  • Confusing ID presence with list retrieval
  • Ignoring plural vs singular rules

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes