From 8d2ba39827518ec50a406d91df6aff687ca8910f Mon Sep 17 00:00:00 2001 From: Mark Fulton Date: Sun, 7 May 2017 06:55:26 -0500 Subject: [PATCH] HTTP Methods: Use 405 when appropriate Use 405 (Method Not Allowed) instead of 404 (Not Found) when a resource exists at the given locator but does not support the specified method (e.g. PUT, PATCH, DELETE on a collection). --- lessons/httpmethods.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lessons/httpmethods.html b/lessons/httpmethods.html index 9b2fad2..dae78d4 100644 --- a/lessons/httpmethods.html +++ b/lessons/httpmethods.html @@ -92,19 +92,19 @@ PUT Update/Replace - 404 (Not Found), unless you want to update/replace every resource in the entire collection. + 405 (Method Not Allowed), unless you want to update/replace every resource in the entire collection. 200 (OK) or 204 (No Content). 404 (Not Found), if ID not found or invalid. PATCH Update/Modify - 404 (Not Found), unless you want to modify the collection itself. + 405 (Method Not Allowed), unless you want to modify the collection itself. 200 (OK) or 204 (No Content). 404 (Not Found), if ID not found or invalid. DELETE Delete - 404 (Not Found), unless you want to delete the whole collection—not often desirable. + 405 (Method Not Allowed), unless you want to delete the whole collection—not often desirable. 200 (OK). 404 (Not Found), if ID not found or invalid.