Bird
0
0

Identify the error in this REST API usage:

medium📝 Debug Q6 of 15
Rest API - HTTP Methods
Identify the error in this REST API usage:
POST /orders {"item": "book"}
POST /orders {"item": "book"}

Why might this cause a problem?
ARepeated POST creates duplicate orders unintentionally
BPOST is idempotent, so no problem occurs
CPOST requests are ignored after the first
DPOST automatically updates existing orders
Step-by-Step Solution
Solution:
  1. Step 1: Understand POST behavior

    POST creates new resources or triggers actions; it is not idempotent.
  2. Step 2: Analyze repeated POST effect

    Sending the same POST twice creates two separate orders, causing duplicates.
  3. Final Answer:

    Repeated POST creates duplicate orders unintentionally -> Option A
  4. Quick Check:

    POST non-idempotent = duplicates possible [OK]
Quick Trick: POST repeats create duplicates; use PUT for idempotency [OK]
Common Mistakes:
MISTAKES
  • Assuming POST is idempotent
  • Expecting POST to update existing resource
  • Thinking POST requests are ignored

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes