ORIONIS API REFERENCE

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 documentation

Undocumented

Static Method _defaultEncoder Encode unsupported types for JSON serialization.
Method __init__ Initialize a JSONResponse with serialized JSON content.
Method render Serialize content to JSON bytes.
Constant _CONTENT_TYPE Undocumented
Class Variable __slots__ Undocumented
Instance Variable _json_default Undocumented
Instance Variable _json_ensure_ascii Undocumented
Instance Variable _json_indent Undocumented
Instance Variable _json_separators Undocumented

Inherited from Response:

Method addHeader Add a header to the response.
Method deleteCookie Delete a cookie by setting its expiration to the past.
Method getBody Return the response body as bytes.
Method getFlashData Return the data queued by withFlash() for the session flash bag.
Method getHeader Get the values for a header.
Method getMediaType Return the media type of the response.
Method getRawHeaders Return the headers as a list of (key, value) byte tuples.
Method getStatusCode Return the HTTP status code of the response.
Method getStream Return the response stream if present.
Method getStringHeaders Return the headers as a list of (key, value) string tuples.
Method hasHeader Check if a header is present.
Method hasStream Check if the response has a stream.
Method removeHeader Remove a header from the response.
Async Method runBackground Run the background task if it exists.
Method setCookie Set a cookie header in the response.
Method setHeader Set a header, replacing any existing values.
Method withCookie Attach a cookie and return the response for chaining.
Method withCookies Attach several cookies at once and return the response.
Method withErrors Flash validation errors for the next request.
Method withFlash Flash a status message into the session and return the response.
Method withInput Flash the submitted payload so the next request can repopulate it.
Method withoutCookie Expire a cookie and return the response for chaining.
Class Variable charset Undocumented
Instance Variable _body Undocumented
Instance Variable _flash Undocumented
Instance Variable _headers Undocumented
Instance Variable _raw_headers Undocumented
Instance Variable _stream Undocumented
Instance Variable background Undocumented
Instance Variable media_type Undocumented
Instance Variable status_code Undocumented
def _defaultEncoder(obj: Any) -> Any: (source)

Encode unsupported types for JSON serialization.

Parameters
obj:AnyThe object to encode.
Returns
AnyThe encoded object suitable for JSON serialization.
Raises
TypeErrorIf the object cannot be encoded for JSON serialization.
def __init__(self, content: Any, status_code: HTTPStatus | int = 200, headers: Mapping[str, str] | None = None, background: BackgroundTask | None = None, *, indent: int | None = None, ensure_ascii: bool = False, separators: tuple[str, str] | None = None, default: Any | None = None): (source)

Initialize a JSONResponse with serialized JSON content.

Parameters
content:AnyContent to serialize as JSON.
status_code:HTTPStatus | int, optionalHTTP status code for the response.
headers:Mapping[str, str] | None, optionalResponse headers to include.
background:BackgroundTask | None, optionalBackground task to run after response.
indent:int | None, optionalIndentation level for pretty-printing JSON.
ensure_ascii:bool, optionalWhether to escape non-ASCII characters.
separators:tuple[str, str] | None, optionalItem and key separators for JSON output.
default:Any | None, optionalCustom encoder for unsupported types.
Returns
NoneThis constructor does not return a value.
def render(self, content: Any) -> bytes: (source)

Serialize content to JSON bytes.

Parameters
content:AnyThe content to serialize as JSON.
Returns
bytesThe serialized JSON content as UTF-8 encoded bytes.
Raises
TypeErrorIf the content cannot be serialized to JSON.
_CONTENT_TYPE: ClassVar[str] = (source)

Undocumented

Value
'application/json; charset=utf-8'
__slots__: tuple[str, ...] = (source)

Undocumented

_json_default = (source)

Undocumented

_json_ensure_ascii = (source)

Undocumented

_json_indent = (source)

Undocumented

_json_separators = (source)

Undocumented