Skip to main content

MethodView

Dispatches request methods to the corresponding instance methods. For example, if you implement a get method, it will be used to handle GET requests.

Attributes

AttributeTypeDescription
methodsset:attr:methods is automatically set based on the methods defined on the class.

Methods


dispatch_request()

@classmethod
def dispatch_request(
**kwargs: t.Any
) - > ft.ResponseReturnValue

Dispatches the incoming request to the instance method matching the HTTP verb (e.g., GET, POST). If a HEAD request is received but no 'head' method is defined, it falls back to the 'get' method.

Parameters

NameTypeDescription
**kwargst.AnyVariable keyword arguments extracted from the URL rule to be passed to the handler method.

Returns

TypeDescription
ft.ResponseReturnValueThe response object or value returned by the specific HTTP method handler.