Bird
0
0

You want to delete multiple resources in one request using REST API. Which approach is best practice?

hard📝 Application Q15 of 15
Rest API - HTTP Methods
You want to delete multiple resources in one request using REST API. Which approach is best practice?
ASend multiple DELETE requests, one per resource URL
BSend a single DELETE request with a JSON array body listing IDs
CUse POST method with action=delete and list of IDs in body
DUse GET method with query parameters to delete resources
Step-by-Step Solution
Solution:
  1. Step 1: Understand REST principles for DELETE

    DELETE targets a single resource URL. Bulk delete is not standardized and often unsupported.
  2. Step 2: Evaluate options for bulk deletion

    Sending multiple DELETE requests (one per resource) is standard and reliable. Other methods misuse HTTP verbs or semantics.
  3. Final Answer:

    Send multiple DELETE requests, one per resource URL -> Option A
  4. Quick Check:

    One DELETE per resource URL [OK]
Quick Trick: Delete resources one by one with separate DELETE requests [OK]
Common Mistakes:
  • Trying to send bulk delete in one DELETE with body
  • Using POST or GET to delete resources
  • Assuming server supports bulk delete by default

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes