Reference
Client mixin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
base url for requests |
required |
trailing
|
str
|
trailing chars (e.g. /) appended to the url |
''
|
**attrs
|
additional Session attributes |
{}
|
Source code in clients/base.py
__truediv__(path)
¶
delete(path='', **kwargs)
¶
get(path='', **kwargs)
¶
head(path='', **kwargs)
¶
options(path='', **kwargs)
¶
patch(path='', json=None, **kwargs)
¶
post(path='', json=None, **kwargs)
¶
put(path='', json=None, **kwargs)
¶
request(method, path, **kwargs)
¶
Send request with relative or absolute path and return response.
Bases: BaseClient, Client
Source code in clients/base.py
stream(method, path, **kwargs)
¶
Send request with relative or absolute path and stream response.
Bases: Client
A Client which returns json content and has syntactic support for requests.
Source code in clients/base.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | |
__call__(path='', **params)
¶
__contains__(path)
¶
authorize(path='', **kwargs)
¶
Acquire oauth access token and set Authorization header.
Source code in clients/base.py
create(path='', json=None, **kwargs)
¶
POST request and return location.
download(file, path='', **kwargs)
¶
request(method, path, **kwargs)
¶
Send request with path and return processed content.
Source code in clients/base.py
stream(method='GET', path='', **kwargs)
¶
Iterate lines or chunks from streamed request.
Source code in clients/base.py
update(path='', callback=None, **json)
¶
PATCH request with json params.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
Callable | None
|
optionally update with GET and validated PUT.
|
None
|
Source code in clients/base.py
updating(path='', **kwargs)
¶
Context manager to GET and conditionally PUT json data.
Bases: Client
A Client which defaults to posts with json bodies, i.e., RPC.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
base url for requests |
required |
json
|
Mapping
|
default json body for all calls |
{}
|
**kwargs
|
same options as |
{}
|
Source code in clients/base.py
Bases: Remote
A Remote client which executes GraphQL queries.
Source code in clients/base.py
check(result)
classmethod
¶
Bases: Client
An extensible embedded proxy client to multiple hosts.
The default implementation provides load balancing based on active connections. It does not provide error handling or retrying.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*urls
|
str
|
base urls for requests |
()
|
**kwargs
|
same options as |
{}
|
Source code in clients/base.py
choice(method)
¶
Return chosen url according to priority.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
str
|
placeholder for extensions which distinguish read/write requests |
required |
Source code in clients/base.py
priority(url)
¶
Return comparable priority for url.
Minimizes errors, failures (500s), and active connections. None may be used to eliminate from consideration.
Source code in clients/base.py
request(method, path, **kwargs)
¶
Send request with relative or absolute path and return response.
Source code in clients/base.py
Bases: BaseClient, AsyncClient
Source code in clients/aio.py
Bases: AsyncClient
An AsyncClient which returns json content and has syntactic support for requests.
Source code in clients/aio.py
authorize(path='', **kwargs)
async
¶
Acquire oauth access token and set Authorization header.
Source code in clients/aio.py
request(method, path, **kwargs)
async
¶
Send request with path and return processed content.
Source code in clients/aio.py
update(path='', callback=None, **json)
async
¶
PATCH request with json params.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
Callable | None
|
optionally update with GET and validated PUT.
|
None
|
Source code in clients/aio.py
updating(path='', **kwargs)
async
¶
Context manager to GET and conditionally PUT json data.
Source code in clients/aio.py
Bases: AsyncClient
An AsyncClient which defaults to posts with json bodies, i.e., RPC.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
base url for requests |
required |
json
|
Mapping
|
default json body for all calls |
{}
|
**kwargs
|
same options as |
{}
|
Source code in clients/aio.py
__call__(path='', **json)
async
¶
POST request with json body and check result.
Bases: AsyncRemote
An AsyncRemote client which executes GraphQL queries.
Source code in clients/aio.py
Bases: AsyncClient
An extensible embedded proxy client to multiple hosts.
The default implementation provides load balancing based on active connections. It does not provide error handling or retrying.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*urls
|
str
|
base urls for requests |
()
|
**kwargs
|
same options as |
{}
|
Source code in clients/aio.py
request(method, path, **kwargs)
async
¶
Send request with relative or absolute path and return response.