Bird
0
0

Given the REST API endpoint DELETE /orders/321, what is the expected result?

medium📝 Predict Output Q5 of 15
Rest API - URL and Resource Design
Given the REST API endpoint DELETE /orders/321, what is the expected result?
AUpdate the order with ID 321
BRetrieve the order with ID 321
CDelete the order with ID 321
DCreate a new order with ID 321
Step-by-Step Solution
Solution:
  1. Step 1: Understand the HTTP method DELETE

    DELETE is used to remove a resource identified by the URL.
  2. Step 2: Interpret the endpoint

    "/orders/321" targets the order resource with ID 321 for deletion.
  3. Final Answer:

    Delete the order with ID 321 -> Option C
  4. Quick Check:

    DELETE + /orders/{id} = delete resource [OK]
Quick Trick: DELETE method removes the resource at the given URL [OK]
Common Mistakes:
MISTAKES
  • Confusing DELETE with GET or POST
  • Assuming it updates or creates resources
  • Ignoring the resource ID in the path

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes