Bird
0
0

Which of the following is the correct syntax to update a resource using HTTP methods?

easy📝 Syntax Q12 of 15
Rest API - HTTP Methods
Which of the following is the correct syntax to update a resource using HTTP methods?
A<code>GET /resource/123</code>
B<code>DELETE /resource/123</code>
C<code>POST /resource/123</code>
D<code>PUT /resource/123</code>
Step-by-Step Solution
Solution:
  1. Step 1: Identify the method used for updating

    PUT is the HTTP method used to update or replace a resource at a specific URL.
  2. Step 2: Check the syntax correctness

    PUT /resource/123 correctly targets the resource with ID 123 for update.
  3. Final Answer:

    PUT /resource/123 -> Option D
  4. Quick Check:

    Update resource = PUT [OK]
Quick Trick: PUT updates existing resources fully [OK]
Common Mistakes:
  • Using GET to update
  • POST is for creating, not updating
  • DELETE removes, not updates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes