class
Kemal::Exceptions::MethodNotAllowed
- Kemal::Exceptions::MethodNotAllowed
- Exception
- Reference
- Object
Overview
Raised when the request path is routed for at least one other HTTP method.
RFC 9110 ยง15.5.6
separates this from a 404: the target resource exists, the method does not
apply to it. #allowed_methods lists the methods that do, and
Kemal::ExceptionHandler renders it into the mandatory Allow response
header.
Defined in:
kemal/helpers/exceptions.crConstructors
-
.new(context : HTTP::Server::Context, allowed_methods : Array(String))
The message is the bare status reason because it doubles as the default response body, and reflecting the request back into it would put client-controlled text on the page.
Instance Method Summary
Constructor Detail
def self.new(context : HTTP::Server::Context, allowed_methods : Array(String))
#
The message is the bare status reason because it doubles as the default
response body, and reflecting the request back into it would put
client-controlled text on the page. The request itself stays reachable
through #context.