Bird
0
0

Which of the following is the correct way to send a PATCH request to update a user's email using JSON?

easy📝 Syntax Q12 of 15
Rest API - HTTP Methods
Which of the following is the correct way to send a PATCH request to update a user's email using JSON?
APATCH /users/123 {"email": "new@example.com"}
BPATCH /users/123 {"username": "newuser"}
CGET /users/123 {"email": "new@example.com"}
DDELETE /users/123 {"email": "new@example.com"}
Step-by-Step Solution
Solution:
  1. Step 1: Identify HTTP method and endpoint

    PATCH is used to update part of the resource at /users/123.
  2. Step 2: Check JSON body for correct field

    The JSON body contains only the field to update, here "email" with new value.
  3. Final Answer:

    PATCH /users/123 {"email": "new@example.com"} -> Option A
  4. Quick Check:

    PATCH + partial JSON body = correct syntax [OK]
Quick Trick: PATCH with only fields to update in JSON body [OK]
Common Mistakes:
  • Using GET or DELETE instead of PATCH
  • Sending unrelated fields in PATCH body
  • Trying to update username when email is asked

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes