class documentation

class MethodNotAllowed(HTTPException):

View In Hierarchy

405 Method Not Allowed

Raise if the server used a method the resource does not handle. For example POST if the resource is view only. Especially useful for REST.

The first argument for this exception should be a list of allowed methods. Strictly speaking the response would be invalid if you don't provide valid methods in the header which you can do with that list.

Method __init__ Takes an optional list of valid http methods starting with werkzeug 0.3 the list will be mandatory.
Method get​_headers Get a list of headers.
Class Variable code Undocumented
Class Variable description Undocumented
Instance Variable valid​_methods Undocumented

Inherited from HTTPException:

Class Method wrap Create an exception that is a subclass of the calling HTTP exception and the exception argument.
Method __call__ Call the exception as WSGI application.
Method __repr__ Undocumented
Method __str__ Undocumented
Method get​_body Get the HTML body.
Method get​_description Get the description.
Method get​_response Get a response object. If one was passed to the exception it's returned directly.
Instance Variable response Undocumented
Property name The status name.
def __init__(self, valid_methods=None, description=None, response=None):
Takes an optional list of valid http methods starting with werkzeug 0.3 the list will be mandatory.
Parameters
valid​_methods:t.Optional[t.Iterable[str]]Undocumented
description:t.Optional[str]Undocumented
response:t.Optional[Response]Undocumented
def get_headers(self, environ=None, scope=None):
Get a list of headers.
Parameters
environ:t.Optional[WSGIEnvironment]Undocumented
scope:t.Optional[dict]Undocumented
Returns
t.List[t.Tuple[str, str]]Undocumented
code: int =
description: str =
valid_methods =

Undocumented