THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class TransportAdapter(ABC): (source)
Known subclasses: orionis.http.adapters.request.asgi.ASGITransportAdapter, orionis.http.adapters.request.rsgi.RSGITransportAdapter
Read/write abstraction over a protocol scope (ASGI or RSGI).
Decouples middleware logic from the underlying transport protocol, allowing all middlewares to operate against a single unified interface regardless of whether the server speaks ASGI or RSGI.
| Method | client |
Return the remote client address parsed from the RSGI/ASGI scope. |
| Method | get |
Return the underlying protocol scope object. |
| Method | headers |
Return the request headers as a Headers object. |
| Method | method |
Return the HTTP method of the current request. |
| Method | path |
Return the URL path of the current request. |
| Method | scheme |
Return the URL scheme of the current request. |
| Method | set |
Set the remote client address in the scope. |
| Method | set |
Set the URL scheme of the current request. |
| Method | set |
Store an arbitrary value in the scope under the given key. |
| Method | wants |
Determine if the client prefers a JSON response based on the Accept header. |
| Class Variable | __slots__ |
Undocumented |
orionis.http.adapters.request.asgi.ASGITransportAdapter, orionis.http.adapters.request.rsgi.RSGITransportAdapterReturn the remote client address parsed from the RSGI/ASGI scope.
| Returns | |
str | None | The client IP address as a string, or None if not available. |
orionis.http.adapters.request.asgi.ASGITransportAdapter, orionis.http.adapters.request.rsgi.RSGITransportAdapterReturn the underlying protocol scope object.
Returns the scope as adjusted by the use of other methods in this adapter. Reflects any modifications made through setClient, setScheme, setState, etc.
| Returns | |
dict | A dict representation of the scope with any overrides applied. The original scope object is never mutated. |
orionis.http.adapters.request.asgi.ASGITransportAdapter, orionis.http.adapters.request.rsgi.RSGITransportAdapterReturn the request headers as a Headers object.
| Returns | |
Headers | The headers parsed from the scope, decoded to strings. |
orionis.http.adapters.request.asgi.ASGITransportAdapter, orionis.http.adapters.request.rsgi.RSGITransportAdapterReturn the HTTP method of the current request.
| Returns | |
str | None | The HTTP method (e.g. 'GET', 'POST'), or None. |
orionis.http.adapters.request.asgi.ASGITransportAdapter, orionis.http.adapters.request.rsgi.RSGITransportAdapterReturn the URL path of the current request.
| Returns | |
str | None | The request path, or None if unavailable. |
orionis.http.adapters.request.asgi.ASGITransportAdapter, orionis.http.adapters.request.rsgi.RSGITransportAdapterReturn the URL scheme of the current request.
| Returns | |
str | None | The scheme (e.g. 'http', 'https'), or None. |
orionis.http.adapters.request.asgi.ASGITransportAdapter, orionis.http.adapters.request.rsgi.RSGITransportAdapterDetermine if the client prefers a JSON response based on the Accept header.
| Returns | |
bool | True if the Accept header indicates JSON is preferred, otherwise False. |
orionis.http.adapters.request.asgi.ASGITransportAdapter, orionis.http.adapters.request.rsgi.RSGITransportAdapterUndocumented