Rest API - HTTP MethodsA developer sends a PATCH request but the server responds with 415 Unsupported Media Type. What is the most likely cause?AThe PATCH method is not supported by the server.BThe Content-Type header is missing or incorrect.CThe request URL is incorrect.DThe JSON body is empty.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand 415 error meaning415 means server cannot process the media type sent in request.Step 2: Check common causesMissing or wrong Content-Type header causes this error.Final Answer:The Content-Type header is missing or incorrect. -> Option BQuick Check:415 error = wrong Content-Type [OK]Quick Trick: Always set Content-Type header for PATCH JSON data [OK]Common Mistakes:Ignoring Content-Type headerAssuming URL causes 415Confusing 415 with 404 or 400
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