ClientResponse Reference
Contents
Public Methods
- pending()
- Checks if the request has completed by calling the
is_set()method on theinternal event object. ReturnsTrueif the request is still in progress.- Returns
Request completion status
- Return type
bool
- wait()
- In async mode, returns the
wait()coroutine of the internal asyncio.Event object.In sync (threaded) mode, calls thewait()method on the internal threading.Event object.- Returns
Awaitable coroutine or None
- Return type
Coroutine or None
API Response Properties
- property endpoint
- Provides access to the endpoint name of the response.
- Raises
RuntimeError – on property modification or deletion.
- Returns
Name of the endpoint.
- Return type
str
- property error
- Provides access to the error dictionary of the response.
- Raises
RuntimeError – on property modification or deletion.
- Returns
Error dict, if there was an error, or None.
- Return type
dict or None
- property data
- Provides access to the data dictionary of the response.
- Raises
RuntimeError – on property modification or deletion.
- Returns
Data dict, if there weren’t any errors, or None.
- Return type
dict or None
Internal Request Properties
- property event
- Provides access to the internal request completion event object.Return type depends on the concurrency mode of the program.In most cases, manual usage of this object is unnecessary.Disclaimer: Incorrect usage of this object can break things.
- Raises
RuntimeError – on property modification or deletion.
- Returns
Reference to the internal event object.
- Return type
asyncio.Event in async mode
- Return type
threading.Event in sync (threaded) mode
- property future
- Provides access to the internal future-like request object.Return type depends on the concurrency mode of the program.In most cases, manual usage of this object is unnecessary.Disclaimer: Incorrect usage of this object can break things.
- Raises
RuntimeError – on property modification or deletion.
- Returns
Reference to the internal future-like object.
- Return type
asyncio.Task in async mode
- Return type
concurrent.futures.Future in sync (threaded) mode