405 Method Not Allowed
The HTTP status meaning the resource exists but does not accept this method, answered with an Allow header listing the methods it does accept.
In more detail
The Allow header is required, because without it the client can only guess which verb to use instead. For example, a collection might accept GET and POST but not PUT.
Example
In the APIs course: The course service answers PUT on the collection with 405 and Allow: GET, HEAD, POST.Related terms
- Allow header — The response header listing the methods a resource accepts, required on every 405 Method Not Allowed answer.
- HTTP method — The verb at the start of a web request that says what the client wants, such as GET to read or POST to create.
Taught in
- HTTP Methods And Status Codes — Modern API Architecture: REST, GraphQL & gRPC