B. The ID should be in the URL path, not in the request body
C. The HTTP method should be POST instead of DELETE
D. The URL is missing the query parameter for ID
Solution
Step 1: Understand DELETE request conventions
DELETE requests usually specify the resource ID in the URL path, not in the body.
Step 2: Identify the error cause
Sending ID in the body causes server to reject request with 400 Bad Request.
Final Answer:
The ID should be in the URL path, not in the request body -> Option B
Quick Check:
ID in URL path for DELETE [OK]
Hint: Put ID in URL path, not body, for DELETE requests [OK]
Common Mistakes:
Sending ID in request body instead of URL
Using wrong HTTP method
Adding unnecessary query parameters
5. You want to test deleting multiple items in Postman using DELETE requests. Which approach correctly applies DELETE requests for multiple IDs [101, 102, 103] following REST best practices?
hard
A. Send one DELETE request per ID with URLs: /items/101, /items/102, /items/103
B. Send a single DELETE request to /items with body {"ids": [101,102,103]}
C. Send one DELETE request to /items?id=101,102,103
D. Send a POST request to /items/delete with body {"ids": [101,102,103]}
Solution
Step 1: Review RESTful DELETE usage for multiple resources
Standard REST APIs usually require one DELETE request per resource ID.
Step 2: Evaluate each option
Send one DELETE request per ID with URLs: /items/101, /items/102, /items/103 sends separate DELETE requests per ID, which is correct. Send a single DELETE request to /items with body {"ids": [101,102,103]} and C misuse body or query parameters. Send a POST request to /items/delete with body {"ids": [101,102,103]} uses POST incorrectly.
Final Answer:
Send one DELETE request per ID with URLs: /items/101, /items/102, /items/103 -> Option A
Quick Check:
One DELETE per resource ID [OK]
Hint: Delete items one by one with separate DELETE URLs [OK]
Common Mistakes:
Trying to delete multiple IDs in one DELETE request body
Using query parameters incorrectly for multiple IDs
Using POST instead of DELETE for deletion
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.