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 ClientResponse: (source)
Store the status, ordered header fields and bounded body of a response.
Repeated header fields retain their wire order.
| Method | body |
Return the complete, bounded response body. |
| Method | client |
Return whether the status is in the client error class. |
| Method | failed |
Return whether the response has an HTTP error status. |
| Method | header |
Return the first matching header or the supplied default. |
| Method | headers |
Return every header field in wire order, including duplicate names. |
| Method | header |
Return every value of a case-insensitive header name. |
| Method | json |
Decode JSON and optionally traverse a dot-separated object path. |
| Method | ok |
Return whether the response has status 200. |
| Method | server |
Return whether the status is in the server error class. |
| Method | status |
Return the HTTP status code. |
| Method | successful |
Return whether the status is in the successful class. |
| Method | text |
Decode using the declared character set, defaulting to UTF-8. |
| Method | throw |
Raise a status exception on 4xx or 5xx, otherwise return this result. |
| Instance Variable | _body |
Complete response body retained after the stream closes. |
| Instance Variable | _headers |
Header fields in received order, including duplicates. |
| Instance Variable | _status |
HTTP status code supplied by the transport. |
Return whether the status is in the client error class.
| Returns | |
bool | True if the status is in the client error class. |
Return whether the response has an HTTP error status.
| Returns | |
bool | True if the response has an HTTP error status. |
Return the first matching header or the supplied default.
| Parameters | |
name:str | Case-insensitive HTTP field name. |
default:str | None | Value returned when the header is absent. |
| Returns | |
str | None | First matching value or the supplied default. |
Decode JSON and optionally traverse a dot-separated object path.
| Parameters | |
path:str | None | Dot-separated object path, or None for the decoded document. |
default:object | Value returned when a path segment is missing. |
| Returns | |
object | Decoded document, selected value or the explicit fallback. |
| Raises | |
HttpDecodeException | If the body contains invalid JSON or exceeds the decoder nesting limit. |
KeyError | If the object path is missing and no default was supplied. |
Return whether the status is in the server error class.
| Returns | |
bool | True if the status is in the server error class. |
Return whether the status is in the successful class.
| Returns | |
bool | True if the status is in the successful class. |
Decode using the declared character set, defaulting to UTF-8.
| Returns | |
str | Decoded response text. |
| Raises | |
HttpDecodeException | If the declared charset is unknown or the body cannot be decoded. |
Raise a status exception on 4xx or 5xx, otherwise return this result.
| Returns | |
ClientResponse | This response after checking its status. |
| Raises | |
HttpStatusException | If the response has a 4xx or 5xx status. |