Attention
This is the documentation for HARP Proxy, actually published as an early preview. Both the software and documentation are a work in progress, and although we already use it on various production servers, they may contain inaccuracies, typographical errors, huge mistakes and empty pages. We work hard to eradicate all mistakes and implement stuff, but it is a long and tedious process. We appreciate your patience and understanding. Of course, any help will be greatly appreciated.
Controllers (harp.controllers)¶
The Controllers (harp.controllers
) package contains the routing and controller logic for the Harp framework.
You probably do not want to use this package unless you’re writing an extension for Harp.
Example usage:
from harp.controllers import RoutingController, GetHandler
class MyController(RoutingController):
@GetHandler("/")
async def index(self):
return "Hello, world!"
Contents¶
- class ControllerResolver[source]¶
Bases:
Protocol
- __init__(*args, **kwargs)¶
- async resolve(request)[source]¶
- Parameters:
request (HttpRequest)
- class DefaultControllerResolver[source]¶
Bases:
ControllerResolver
- async resolve(request)[source]¶
- Parameters:
request (HttpRequest)
- class ProxyControllerResolver[source]¶
Bases:
DefaultControllerResolver
- async resolve(request)[source]¶
- Parameters:
request (HttpRequest)
- property ports¶
- class RoutingController[source]¶
Bases:
object
- RouterType¶
alias of
Router
- RouterArguments = <harp.utils.arguments.Arguments object>¶
- prefix = None¶
- async dump_request_controller(request)[source]¶
TODO: use orjson ?
- Parameters:
request (HttpRequest)