APIWrapper Documentation¶
This is the API documentation for the APIWrapper class and send_request function in the AniLinkPy module.
APIWrapper Class¶
This class represents a wrapper for the API.
| ATTRIBUTE | DESCRIPTION |
|---|---|
base_url |
The base URL for the API.
TYPE:
|
| PARAMETER | DESCRIPTION |
|---|---|
base_url |
The base URL for the API.
TYPE:
|
Source code in AniLinkPy/base/APIWrapper.py
send_request Function¶
This function sends a request to the specified URL.
| PARAMETER | DESCRIPTION |
|---|---|
url |
The URL to send the request to.
TYPE:
|
method |
The HTTP method to use for the request. Supports 'GET' and 'POST'.
TYPE:
|
data |
The data to include in the request. Defaults to None.
TYPE:
|
token |
The authentication token. Defaults to None.
TYPE:
|
timeout |
The number of seconds the client will wait for the server to send a response.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
UnsupportedMethodError
|
If an unsupported method is provided. |
RequestError
|
If there is an error in the request response. |
| RETURNS | DESCRIPTION |
|---|---|
dict
|
The JSON response from the request.
TYPE:
|