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
class ResponseTemplate: (source)
Constructor: ResponseTemplate(content, status_code, headers, media_type)
Store validated immutable content for independent response instances.
| Parameters | |
| content | Constant response content, encoded once as UTF-8. |
| status | HTTP status shared by newly created responses. |
| headers | Constant headers copied and encoded when the template is constructed. |
| media | Response media type metadata. |
| Method | __init__ |
Validate and snapshot constant response content and headers. |
| Method | make |
Create a response with independent headers, cookies, and background. |
| Class Variable | _headers |
Undocumented |
| Class Variable | _raw |
Undocumented |
| Class Variable | body |
Undocumented |
| Class Variable | media |
Undocumented |
| Class Variable | status |
Undocumented |
def __init__(self, content:
bytes | str = b'', status_code: int = 200, headers: Mapping[ str, str] | None = None, media_type: str | None = None):
(source)
¶
Validate and snapshot constant response content and headers.
| Parameters | |
content:bytes | str, optional | Constant content to encode once. |
statusint, optional | Valid HTTP response status. |
headers:Mapping[str, str] | None, optional | Constant headers copied from the caller's mapping. |
mediastr | None, optional | Media type metadata copied to each response. |
| Returns | |
None | The immutable template is initialized. |
| Raises | |
TypeError | If the content is not text or bytes, or headers are not strings. |
Create a response with independent headers, cookies, and background.
| Returns | |
Response | Mutable response sharing only immutable body and encoded headers. |