What 501 Not Implemented means
501 Not Implemented means the server does not know how to handle the request method at all (TRACE, CONNECT) or does not implement a feature requested in headers (e.g. unknown Transfer-Encoding). It is different from 405 Method Not Allowed: 405 means "this resource does not support this method"; 501 means "this server does not support this method, period".
When servers should return it: Return 501 when the server lacks support for a method or feature, not when a specific resource refuses the method.
Common causes
- TRACE or CONNECT method requested
- Server does not implement HTTP/2 push and request includes related directive
- Unknown Transfer-Encoding
How to fix 501 Not Implemented
- Use a different method
- Check the OPTIONS response to see what methods are supported
Example response
HTTP/2 501
content-type: text/plain
Method not implemented
More references
For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.