AES Encryption Explained: How It Works and Why It Matters
Jun 23, 2026
5xx Server Error
The 501 (Not Implemented) status code indicates that the server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.
If your server only supports GET and POST methods and receives a PATCH request, return 501 Not Implemented. This tells the client that the server intentionally does not support this HTTP method for any resource, unlike 405 which would indicate the method is known but not allowed on the specific endpoint.
// PHP - returning 501 for unsupported methods
$method = $_SERVER['REQUEST_METHOD'];
if (!in_array($method, ['GET', 'POST'])) {
http_response_code(501);
echo json_encode(['error' => "Method $method not implemented"]);
exit;
}
Mistake: Using 501 instead of 405 for endpoints that do not support a method
Fix: Use 405 Method Not Allowed when the server supports the method in general but not for the specific endpoint. Use 501 when the server does not implement the method at all.
Blog
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026