Bird
0
0

What is the expected result of the REST API call PUT /orders/789 with a JSON body containing updated order details?

medium📝 Predict Output Q5 of 15
Rest API - REST API Fundamentals
What is the expected result of the REST API call PUT /orders/789 with a JSON body containing updated order details?
ACreate a new order without specifying ID
BUpdate the order with ID 789 using the provided details
CRetrieve the order with ID 789
DDelete the order with ID 789
Step-by-Step Solution
Solution:
  1. Step 1: Understand HTTP PUT method

    PUT is used to update or replace a resource at the specified URI.
  2. Step 2: Analyze the call

    PUT /orders/789 with data updates the order with ID 789, so Update the order with ID 789 using the provided details is correct.
  3. Final Answer:

    Update the order with ID 789 using the provided details -> Option B
  4. Quick Check:

    PUT = Update resource [OK]
Quick Trick: PUT replaces or updates resource at URI [OK]
Common Mistakes:
  • Confusing PUT with POST
  • Assuming PUT creates without ID
  • Mixing up update and delete actions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes