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 StreamingResponse(Response): (source)
Known subclasses: orionis.http.EventStreamResponse, orionis.http.FileResponse
Constructor: StreamingResponse(content, status_code, headers, media_type, ...)
Undocumented
| Method | __init__ |
Initialize a streaming response. |
| Async Method | _wrap |
Adapt a synchronous iterable of bytes to an asynchronous iterable. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _body |
Undocumented |
Inherited from Response:
| 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 | get |
Return the headers as a list of (key, value) string tuples. |
| 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 |
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 |
Flash the submitted payload so the next request can repopulate it. |
| Method | without |
Expire a cookie and return the response for chaining. |
| Class Variable | charset |
Undocumented |
| Instance Variable | _flash |
Undocumented |
| Instance Variable | _headers |
Undocumented |
| Instance Variable | _raw |
Undocumented |
| Instance Variable | _stream |
Undocumented |
| Instance Variable | background |
Undocumented |
| Instance Variable | media |
Undocumented |
| Instance Variable | status |
Undocumented |
def __init__(self, content:
AsyncIterable[ bytes] | Iterable[ bytes], status_code: HTTPStatus | int = 200, headers: Mapping[ str, str] | None = None, media_type: str | None = None, background: BackgroundTask | None = None):
(source)
¶
overrides
orionis.http.Response.__init__overridden in
orionis.http.EventStreamResponse, orionis.http.FileResponseInitialize a streaming response.
| Parameters | |
content:AsyncIterable[bytes] | Iterable[bytes] | Streaming content source. |
statusHTTPStatus | int, optional | HTTP status code for the response. |
headers:Mapping[str, str] | None, optional | Optional response headers. |
mediastr | None, optional | Optional media type for the response. |
background:BackgroundTask | None, optional | Optional background task to run after response. |
| Returns | |
None | This constructor does not return a value. |
overrides
orionis.http.Response.__slots__overridden in
orionis.http.EventStreamResponse, orionis.http.FileResponseUndocumented