Bird
0
0

You send this PATCH request payload to update multiple items:

medium📝 Debug Q14 of 15
Rest API - Batch and Bulk Operations
You send this PATCH request payload to update multiple items:
[{"id":1,"status":"done"}, {"status":"pending"}]

What is the likely problem?
AMissing 'id' in second object causes update failure or error.
BThe payload is valid and will update all items.
CUsing PATCH instead of POST causes syntax error.
DThe array should be empty for batch updates.
Step-by-Step Solution
Solution:
  1. Step 1: Check each object in payload

    The second object lacks 'id', so the server cannot identify which item to update.
  2. Step 2: Understand update requirements

    Each update must specify the item to update, usually by 'id'. Missing it causes failure or error.
  3. Final Answer:

    Missing 'id' in second object causes update failure or error. -> Option A
  4. Quick Check:

    Each update needs an identifier like 'id' [OK]
Quick Trick: Every update object must include an identifier like 'id' [OK]
Common Mistakes:
MISTAKES
  • Assuming missing 'id' is allowed
  • Confusing PATCH with POST errors
  • Thinking empty arrays are required

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes