|
None | __init__ (self, str host="http://127.0.0.1", int port=6000, int delay=2) |
|
requests.Response | get_endpoint (self, str path, Union[Dict[str, Any], None] content=None, Union[Mapping[str, str], None] header=None) |
|
requests.Response | post_endpoint (self, str path, Union[Dict[str, Any], None] content=None, Union[Mapping[str, str], None] header=None) |
|
requests.Response | put_endpoint (self, str path, Union[Dict[str, Any], None] content=None, Union[Mapping[str, str], None] header=None) |
|
requests.Response | patch_endpoint (self, str path, Union[Dict[str, Any], None] content=None, Union[Mapping[str, str], None] header=None) |
|
requests.Response | delete_endpoint (self, str path, Union[Dict[str, Any], None] content=None, Union[Mapping[str, str], None] header=None) |
|
int | get_status (self, requests.Response response) |
|
_summary_
This is the class in charge of containing the boilerplate endpoint functions.
Definition at line 5 of file query_boilerplate.py.
◆ __init__()
None query_boilerplate.QueryEndpoint.__init__ |
( |
| self, |
|
|
str | host = "http://127.0.0.1", |
|
|
int | port = 6000, |
|
|
int | delay = 2 ) |
◆ delete_endpoint()
requests.Response query_boilerplate.QueryEndpoint.delete_endpoint |
( |
| self, |
|
|
str | path, |
|
|
Union[Dict[str, Any], None] | content = None, |
|
|
Union[Mapping[str, str], None] | header = None ) |
_summary_
This function is in charge of sending a DELETE request to the server.
Args:
path (str): _description_: The path of the endpoint.
content (Union[Dict[str, Any], None], optional): _description_: The content to be sent to the server.
header (Union[Mapping[str, str], None], optional): _description_: The header to be sent to the server. Defaults to None.
Returns:
requests.Response: _description_: The response from the server.
Definition at line 114 of file query_boilerplate.py.
◆ get_endpoint()
requests.Response query_boilerplate.QueryEndpoint.get_endpoint |
( |
| self, |
|
|
str | path, |
|
|
Union[Dict[str, Any], None] | content = None, |
|
|
Union[Mapping[str, str], None] | header = None ) |
_summary_
This function is in charge of sending a GET request to the server.
Args:
path (str): _description_: The path of the endpoint.
content (Union[Dict[str, Any], None], optional): _description_: The content to be sent to the server.
header (Union[Mapping[str, str], None], optional): _description_: The header to be sent to the server. Defaults to None.
Returns:
requests.Response: _description_: The response from the server.
Definition at line 18 of file query_boilerplate.py.
◆ get_status()
int query_boilerplate.QueryEndpoint.get_status |
( |
| self, |
|
|
requests.Response | response ) |
_summary_
This function is in charge of getting the status code from the response.
Args:
response (requests.Response): _description_: The response from the server.
Returns:
int: _description_: The status code from the response.
Definition at line 138 of file query_boilerplate.py.
◆ patch_endpoint()
requests.Response query_boilerplate.QueryEndpoint.patch_endpoint |
( |
| self, |
|
|
str | path, |
|
|
Union[Dict[str, Any], None] | content = None, |
|
|
Union[Mapping[str, str], None] | header = None ) |
_summary_
This function is in charge of sending a PATCH request to the server.
Args:
path (str): _description_: The path of the endpoint.
content (Union[Dict[str, Any], None], optional): _description_: The content to be sent to the server.
header (Union[Mapping[str, str], None], optional): _description_: The header to be sent to the server. Defaults to None.
Returns:
requests.Response: _description_: The response from the server.
Definition at line 90 of file query_boilerplate.py.
◆ post_endpoint()
requests.Response query_boilerplate.QueryEndpoint.post_endpoint |
( |
| self, |
|
|
str | path, |
|
|
Union[Dict[str, Any], None] | content = None, |
|
|
Union[Mapping[str, str], None] | header = None ) |
_summary_
This function is in charge of sending a POST request to the server.
Args:
path (str): _description_: The path of the endpoint.
content (Union[Dict[str, Any], None], optional): _description_: The content to be sent to the server.
header (Union[Mapping[str, str], None], optional): _description_: The header to be sent to the server. Defaults to None.
Returns:
requests.Response: _description_: The response from the server.
Definition at line 42 of file query_boilerplate.py.
◆ put_endpoint()
requests.Response query_boilerplate.QueryEndpoint.put_endpoint |
( |
| self, |
|
|
str | path, |
|
|
Union[Dict[str, Any], None] | content = None, |
|
|
Union[Mapping[str, str], None] | header = None ) |
_summary_
This function is in charge of sending a PUT request to the server.
Args:
path (str): _description_: The path of the endpoint.
content (Union[Dict[str, Any], None], optional): _description_: The content to be sent to the server.
header (Union[Mapping[str, str], None], optional): _description_: The header to be sent to the server. Defaults to None.
Returns:
requests.Response: _description_: The response from the server.
Definition at line 66 of file query_boilerplate.py.
◆ _delay
query_boilerplate.QueryEndpoint._delay = delay |
|
protected |
◆ _host
str query_boilerplate.QueryEndpoint._host = f"http://{host}" |
|
protected |
◆ _port
query_boilerplate.QueryEndpoint._port = port |
|
protected |
The documentation for this class was generated from the following file: