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.
Define the contract for response implementations.
| Method | add |
Add a header to the response. |
| Method | delete |
Delete a cookie by setting its expiration to the past. |
| Method | get |
Return the response body as bytes. |
| Method | get |
Return the data queued by withFlash() for the session flash bag. |
| Method | get |
Get the values for a header. |
| Method | get |
Return the media type of the response. |
| Method | get |
Return the headers as a list of (key, value) byte tuples. |
| Method | get |
Return the HTTP status code of the response. |
| Method | get |
Return the response stream if present. |
| Method | has |
Check if a header is present. |
| Method | has |
Check if the response has a stream. |
| Method | remove |
Remove a header from the response. |
| Method | render |
Render the content to bytes. |
| Async Method | run |
Run the background task if it exists. |
| Method | set |
Set a cookie header in the response. |
| Method | set |
Set a header, replacing any existing values. |
| Method | with |
Set the background task and return the response. |
| Method | with |
Attach a cookie and return the response for chaining. |
| Method | with |
Attach several cookies at once and return the response. |
| Method | with |
Flash validation errors for the next request. |
| Method | with |
Flash a status message into the session and return the response. |
| Method | with |
Merge response headers and return the response. |
| Method | with |
Flash the submitted payload so the next request can repopulate it. |
| Method | without |
Expire a cookie and return the response for chaining. |
| Method | with |
Set the HTTP status code and return the response. |
| Class Variable | __slots__ |
Declare that this class introduces no additional instance slots. |
orionis.http.Responseorionis.http.ResponseReturn the response body as bytes.
| Returns | |
bytes | None | The response body as bytes, or None if not set. |
orionis.http.ResponseReturn the data queued by withFlash() for the session flash bag.
| Returns | |
dict[str, typing.Any] | None | The queued key-value pairs, or None when nothing was queued. |
orionis.http.ResponseReturn the media type of the response.
| Returns | |
str | None | The media type, or None if not set. |
orionis.http.ResponseReturn the HTTP status code of the response.
| Returns | |
int | The HTTP status code. |
orionis.http.ResponseReturn the response stream if present.
| Returns | |
collections.abc.AsyncIterable[bytes] | None | The response stream, or None if not set. |
orionis.http.ResponseCheck if the response has a stream.
| Returns | |
bool | True if a stream is present, False otherwise. |
orionis.http.ResponseRender the content to bytes.
| Parameters | |
content:typing.Any | The content to render. |
| Returns | |
bytes | The rendered content as bytes. |
orionis.http.ResponseRun the background task if it exists.
| Returns | |
None | This method does not return a value. |
str, value: str = '', *, max_age: int | None = None, expires: datetime | str | int | None = None, path: str | None = '/', domain: str | None = None, secure: bool = False, http_only: bool = False, same_site: Literal[ 'lax', 'strict', 'none'] | None = 'lax', partitioned: bool = False):
(source)
¶
orionis.http.ResponseSet a cookie header in the response.
| Parameters | |
key:str | The cookie name. |
value:str, optional | The cookie value. Defaults to an empty string. |
maxint | None, optional | The maximum age of the cookie in seconds. |
expires:datetime.datetime | str | int | None, optional | The expiration date of the cookie. |
path:str | None, optional | The path for which the cookie is valid. |
domain:str | None, optional | The domain for which the cookie is valid. |
secure:bool, optional | Whether the cookie is secure. |
httpbool, optional | Whether the cookie is HTTP only. |
samestr | None, optional | The SameSite policy for the cookie. |
partitioned:bool, optional | Whether the cookie is partitioned. |
| Returns | |
None | This method does not return a value. |
str, value: str = '', *, max_age: int | None = None, expires: datetime | str | int | None = None, path: str | None = '/', domain: str | None = None, secure: bool = False, http_only: bool = False, same_site: Literal[ 'lax', 'strict', 'none'] | None = 'lax', partitioned: bool = False) -> Self:
(source)
¶
orionis.http.ResponseAttach a cookie and return the response for chaining.
| Parameters | |
key:str | The cookie name. |
value:str, optional | The cookie value. Defaults to an empty string. |
maxint | None, optional | The maximum age of the cookie in seconds. |
expires:datetime.datetime | str | int | None, optional | The expiration date of the cookie. |
path:str | None, optional | The path for which the cookie is valid. |
domain:str | None, optional | The domain for which the cookie is valid. |
secure:bool, optional | Whether the cookie is secure. |
httpbool, optional | Whether the cookie is HTTP only. |
samestr | None, optional | The SameSite policy for the cookie. |
partitioned:bool, optional | Whether the cookie is partitioned. |
| Returns | |
typing.Self | The same response instance, allowing fluent chaining. |
orionis.http.ResponseAttach several cookies at once and return the response.
| Parameters | |
cookies:Mapping[str, str | Mapping[str, Any]] | Mapping of cookie names to either a plain value or a mapping of
keyword arguments accepted by
orionis.http.contracts.response.IResponse.setCookie. |
| Returns | |
typing.Self | The same response instance, allowing fluent chaining. |
Flash validation errors for the next request.
| Parameters | |
errors:collections.abc.Mapping[str, typing.Any] | Exception | Mapping of field to message(s), or a validation exception. |
| Returns | |
typing.Self | The same response instance, allowing fluent chaining. |
Flash a status message into the session and return the response.
| Parameters | |
key:str | Flash data key. |
value:typing.Any, optional | Value to flash. |
| Returns | |
typing.Self | The same response instance, allowing fluent chaining. |
orionis.http.ResponseMerge response headers and return the response.
Replace existing values for each supplied name without changing unrelated headers. Header names are compared without regard to case.
| Parameters | |
headers:collections.abc.Mapping[str, str] | Header names and values to apply through setHeader(). |
| Returns | |
Self | The same response, enabling fluent chaining. |
| Raises | |
TypeError | If headers is not a mapping. |
Flash the submitted payload so the next request can repopulate it.
| Parameters | |
values:collections.abc.Mapping[str, typing.Any] | Submitted form payload to remember. Credential-like fields are stripped before storing. |
| Returns | |
typing.Self | The same response instance, allowing fluent chaining. |
str, *, path: str = '/', domain: str | None = None) -> Self:
(source)
¶
orionis.http.ResponseExpire a cookie and return the response for chaining.
| Parameters | |
key:str | The name of the cookie to delete. |
path:str, default "/" | The path for which the cookie is valid. |
domain:str | None, optional | The domain for which the cookie is valid. |
| Returns | |
typing.Self | The same response instance, allowing fluent chaining. |
orionis.http.ResponseSet the HTTP status code and return the response.
| Parameters | |
statusorionis.http.enums.HTTPStatus | int | HTTP status code between 100 and 599. |
| Returns | |
Self | The same response, enabling fluent chaining. |
| Raises | |
TypeError | If status_code is not an integer. |
ValueError | If status_code is outside the accepted HTTP range. |
orionis.http.ResponseDeclare that this class introduces no additional instance slots.