Bird
0
0

Consider this batch delete request:

medium📝 Debug Q14 of 15
Rest API - Batch and Bulk Operations

Consider this batch delete request:
DELETE /items
with JSON body:
{ "ids": [10, 20, 30] }
But the server responds with 400 Bad Request. What is the likely cause?

AThe JSON format is incorrect.
BThe server expects IDs in the query string, not body.
CThe DELETE method cannot have a request body.
DThe IDs array is empty.
Step-by-Step Solution
Solution:
  1. Step 1: Check DELETE method usage

    Some APIs require IDs in query string, not in request body for DELETE.
  2. Step 2: Identify server expectation

    Since server returns 400, it likely expects IDs in query parameters, not JSON body.
  3. Final Answer:

    The server expects IDs in the query string, not body. -> Option B
  4. Quick Check:

    Server expects IDs in query, not body [OK]
Quick Trick: Check if server wants IDs in query or body for DELETE [OK]
Common Mistakes:
MISTAKES
  • Assuming DELETE cannot have a body always
  • Thinking JSON format is wrong without checking
  • Ignoring server API documentation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes