501 Not Implemented

Server Error - Functionality not supported

HTTP 501 Not Implemented

What It Means

The HTTP 501 Not Implemented status code indicates that the server does not support the functionality required to fulfill the request. This is typically used when the server doesn't recognize the request method at all.

501 vs 405

  • 405: "I know this method, but it's not allowed on this resource"
  • 501: "I don't support this method at all on any resource"

When to Use 501

  • Unrecognized HTTP methods: Custom method server doesn't handle
  • WebDAV methods: PROPFIND, MKCOL, COPY, MOVE on non-WebDAV server
  • Future HTTP methods: New methods not yet implemented
  • Proxy limitations: Proxy can't handle certain methods

Example Response

PROPFIND /resource HTTP/1.1
Host: example.com

---

HTTP/1.1 501 Not Implemented
Content-Type: application/json

{
  "error": "Not Implemented",
  "message": "The PROPFIND method is not supported"
}

Comparison Table

Scenario Status
DELETE on /users/:id (not allowed) 405
PROPFIND on any endpoint 501
Custom "PURGE" method 501
PUT on read-only endpoint 405

Implementation

Express.js

const supportedMethods = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'];

app.use((req, res, next) => {
  if (!supportedMethods.includes(req.method)) {
    return res.status(501).json({
      error: 'Not Implemented',
      message: `The ${req.method} method is not supported`
    });
  }
  next();
});

Nginx

# Nginx returns 501 for methods it doesn't understand by default
# For custom handling:
if ($request_method !~ ^(GET|POST|PUT|DELETE|OPTIONS)$ ) {
    return 501;
}

Common HTTP Methods

Standard Methods (should NOT return 501):

GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS

WebDAV Methods (may return 501):

PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK

Best Practices

  • Most REST APIs should handle standard HTTP methods (use 405, not 501)
  • Return 501 for truly unsupported methods like WebDAV
  • Include a clear message about what is not supported
  • Consider if you actually mean 405 instead

Frequently Asked Questions

What is the difference between HTTP 501 and 405?
A 405 Method Not Allowed means the server recognizes the HTTP method but it is not permitted on the specific resource (e.g., DELETE on a read-only endpoint). A 501 Not Implemented means the server does not support the method at all across any resource, such as a WebDAV PROPFIND method on a standard HTTP server.
When should a server return 501 Not Implemented?
A server should return 501 when it receives an HTTP method it does not recognize or support, such as custom methods (PURGE), WebDAV methods (PROPFIND, MKCOL) on non-WebDAV servers, or future HTTP methods that have not yet been implemented.
Is 501 a server error or a client error?
501 is classified as a server error (5xx), not a client error. It indicates a limitation of the server rather than a mistake in the client request. The client's request may be syntactically valid, but the server lacks the functionality to fulfill it.
How rare is the 501 status code in practice?
501 is relatively rare in modern web applications because most servers and frameworks support all standard HTTP methods (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS). You are most likely to encounter it with custom or WebDAV methods on servers that do not support them.
How do I fix a 501 Not Implemented error?
If you are the client, verify you are using a standard HTTP method and check the server's documentation for supported methods. If you are the server operator, implement support for the requested method or return 405 instead if the method is recognized but disallowed on that specific resource.

Monitor your API endpoints

Track unexpected 501 errors across your services.

Start monitoring free →

Related Status Codes

More Resources