Developer interface¶
OBRequests¶
- class OBRequests.OBRequests¶
- close_¶
Used to close any underlying sessions.
- Type
Callable[[], Awaitable]
- base_¶
Interact with the base of the client.
- Type
Union[_BlockingRequestHandler, _AwaitingRequestHandler]
- __init__(base_url: str, responses: RESPONSES = {}, globals_: dict = {}, awaiting: bool = False, **kwargs) None ¶
This method is called to create a new client .
- Parameters
base_url (URLTypes) –
responses ("RESPONSES", optional) – by default {}
awaiting (bool, optional) – If client should be async or not by default False
globals (dict, optional) – Globals vars to be passed to every callback.
auth (AuthTypes, optional) – by default None
params (QueryParamTypes, optional) – by default None
headers (HeaderTypes, optional) – by default None
cookies (CookieTypes, optional) – by default None
verify (VerifyTypes, optional) – by default True
cert (CertTypes, optional) – by default None
http1 (bool, optional) – by default True
http2 (bool, optional) – by default False
proxies (ProxiesTypes, optional) – by default None
mounts (Mapping[str, BaseTransport], optional) – by default None
timeout (TimeoutTypes, optional) – by default …
limits (Limits, optional) – by default …
max_redirects (int, optional) – by default …
event_hooks (Mapping[str, List[Callable]], optional) – by default None
transport (BaseTransport, optional) – by default None
app (Callable, optional) – by default None
trust_env (bool, optional) – by default True
Route¶
- class OBRequests.Route¶
- __init__(path: str, methods: List[OBRequests._methods.Method] = [], responses: RESPONSES = {}, path_params: dict = {}, **kwargs) None ¶
Route
- Parameters
path (str) –
methods (List[Method], optional) – by default []
responses ("RESPONSES", optional) – by default {}
path_params (dict, optional) – by default {}
auth (AuthTypes, optional) – by default None
params (QueryParamTypes, optional) – by default None
headers (HeaderTypes, optional) – by default None
cookies (CookieTypes, optional) – by default None
verify (VerifyTypes, optional) – by default True
cert (CertTypes, optional) – by default None
http1 (bool, optional) – by default True
http2 (bool, optional) – by default False
proxies (ProxiesTypes, optional) – by default None
mounts (Mapping[str, BaseTransport], optional) – by default None
timeout (TimeoutTypes, optional) – by default …
limits (Limits, optional) – by default …
max_redirects (int, optional) – by default …
event_hooks (Mapping[str, List[Callable]], optional) – by default None
transport (BaseTransport, optional) – by default None
app (Callable, optional) – by default None
trust_env (bool, optional) – by default True
Method¶
- class OBRequests._methods.Method¶
- __init__(responses: RESPONSES = {}, path_params: dict = {}, **kwargs) None ¶
Initialize the method for this request.
- Parameters
responses ("RESPONSES", optional) – by default {}
path_params (dict) – by default {}
auth (AuthTypes, optional) – by default None
params (QueryParamTypes, optional) – by default None
headers (HeaderTypes, optional) – by default None
cookies (CookieTypes, optional) – by default None
verify (VerifyTypes, optional) – by default True
cert (CertTypes, optional) – by default None
http1 (bool, optional) – by default True
http2 (bool, optional) – by default False
proxies (ProxiesTypes, optional) – by default None
mounts (Mapping[str, BaseTransport], optional) – by default None
timeout (TimeoutTypes, optional) – by default …
limits (Limits, optional) – by default …
max_redirects (int, optional) – by default …
event_hooks (Mapping[str, List[Callable]], optional) – by default None
transport (BaseTransport, optional) – by default None
app (Callable, optional) – by default None
trust_env (bool, optional) – by default True
Request handler¶
- class OBRequests._BlockingRequestHandler¶
- delete(**kwargs)¶
Makes a DELETE request to the API endpoint
- get(**kwargs)¶
Makes a GET request to the API endpoint
- head(**kwargs)¶
Makes a HEAD request to the API endpoint
- patch(**kwargs)¶
Makes a PATCH request to the API endpoint
- post(**kwargs)¶
Makes a POST request to the API endpoint
- put(**kwargs)¶
Makes a PUT request to the API endpoint