Bird
0
0

If a client sends a POST request to /items with new data, what is the typical server response?

medium📝 Predict Output Q5 of 15
Rest API - HTTP Methods
If a client sends a POST request to /items with new data, what is the typical server response?
ADelete the item at /items
BReplace all items with the new data
CCreate a new item and return its location
DRetrieve all items without changes
Step-by-Step Solution
Solution:
  1. Step 1: Understand POST method usage

    POST is used to create new resources, often returning the new resource's URL.
  2. Step 2: Match server response to POST

    Creating a new item and returning its location fits POST behavior.
  3. Final Answer:

    POST creates new item and returns location -> Option C
  4. Quick Check:

    POST method creates resource = true [OK]
Quick Trick: POST creates new resources and returns their URL [OK]
Common Mistakes:
MISTAKES
  • Thinking POST replaces all data
  • Using POST to delete
  • Expecting GET behavior from POST

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes