Rest API - HTTP MethodsWhich 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"}Check Answer
Step-by-Step SolutionSolution:Step 1: Identify HTTP method and endpointPATCH is used to update part of the resource at /users/123.Step 2: Check JSON body for correct fieldThe JSON body contains only the field to update, here "email" with new value.Final Answer:PATCH /users/123 {"email": "new@example.com"} -> Option AQuick 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 PATCHSending unrelated fields in PATCH bodyTrying to update username when email is asked
Master "HTTP Methods" in Rest API9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Rest API Quizzes HTTP Methods - PUT for full replacement - Quiz 7medium HTTP Methods - POST for creating resources - Quiz 9hard HTTP Status Codes - 409 Conflict - Quiz 11easy HTTP Status Codes - 400 Bad Request - Quiz 2easy Query Parameters and Filtering - Multiple filter parameters - Quiz 15hard Query Parameters and Filtering - Pagination with limit and offset - Quiz 2easy Query Parameters and Filtering - Sort direction (asc, desc) - Quiz 10hard REST API Fundamentals - REST constraints and principles - Quiz 13medium REST API Fundamentals - Why REST APIs exist - Quiz 15hard URL and Resource Design - Why URL structure communicates meaning - Quiz 7medium