Bird
0
0

You want to update multiple fields of a user resource partially using PATCH. Which JSON body correctly updates the user's email and address?

hard📝 Application Q8 of 15
Rest API - HTTP Methods
You want to update multiple fields of a user resource partially using PATCH. Which JSON body correctly updates the user's email and address?
A{"email": "user@example.com", "address": "123 Main St"}
B{"email": "user@example.com" "address": "123 Main St"}
C["email": "user@example.com", "address": "123 Main St"]
D{"email": "user@example.com", "address": ["123 Main St"]}
Step-by-Step Solution
Solution:
  1. Step 1: Check JSON syntax correctness

    {"email": "user@example.com", "address": "123 Main St"} is valid JSON with comma separating fields.
  2. Step 2: Validate data types

    Address is a string, not an array, which matches typical resource format.
  3. Final Answer:

    {"email": "user@example.com", "address": "123 Main St"} -> Option A
  4. Quick Check:

    Valid JSON with commas and correct types [OK]
Quick Trick: Separate fields with commas in JSON objects [OK]
Common Mistakes:
  • Missing commas between fields
  • Using arrays instead of strings incorrectly
  • Using brackets instead of braces

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes