genvid.toolbox.BaseHttpApiTool¶
-
class
genvid.toolbox.
BaseHttpApiTool
(**kwargs)¶ Bases:
genvid.toolbox.basetool.BaseTool
This is the base class for the HTTP API.
-
get_base_url
(timeout=0.0) → str¶ Return the base url for this service api.
-
request_get
(path: str, base_url: str = None, timeout=0.0, params: dict = None, retry_request: bool = False)¶ Run a GET HTTP request over the cluster service.
Parameters: - path – The HTTP request path.
- base_url – Alternative URL address.
- timeout – The request timeout.
- params – Parameters used for the query string.
-
request_post
(path: str, base_url: str = None, timeout=0.0, params: dict = None, data: str = None, json_data=None)¶ Run a POST HTTP request over the cluster service.
Parameters: - path – The HTTP request path.
- base_url – Alternative URL address.
- timeout – The request timeout.
- params – Parameters used for the query string.
- json_data – A dictionary that will be transform into JSON.
- data – The text data.
-
request_put
(path: str, base_url: str = None, timeout=0.0, params: dict = None, data: str = None, json_data=None)¶ Run a PUT HTTP request over the cluster service.
Parameters: - path – The HTTP request path.
- base_url – Alternative URL address.
- timeout – The request timeout.
- params – Parameters used for the query string.
- json_data – A dictionary that will be transform into JSON.
- data – The text data.
-
request_delete
(path: str, base_url: str = None, timeout=0.0, params: dict = None, data: str = None, json_data=None)¶ Run a DELETE HTTP request over the cluster service.
Parameters: - path – The HTTP request path.
- base_url – Alternative URL address.
- timeout – The request timeout.
- params – Parameters used for the query string.
- json_data – A dictionary that will be transform into JSON.
- data – The text data.
-
-
class
httpapi.
BaseHttpApiTool
¶ Implementation of
genvid.toolbox.BaseHttpApiTool