LargeAPI
A class with many methods that would normally be split.
Usage
LargeAPI()With inline_methods: true, all methods stay on the class page regardless of count.
Parameters
base_url: str-
The API base URL.
Methods
| Name | Description |
|---|---|
| authenticate() | Set authentication token. |
| delete() | Perform a DELETE request. |
| get() | Perform a GET request. |
| head() | Perform a HEAD request. |
| options() | Perform an OPTIONS request. |
| patch() | Perform a PATCH request. |
| post() | Perform a POST request. |
| put() | Perform a PUT request. |
authenticate()
Set authentication token.
Usage
authenticate(token)Parameters
token: str-
Bearer token for authentication.
delete()
Perform a DELETE request.
Usage
delete(endpoint)Parameters
endpoint: str-
The API endpoint path.
Returns
bool-
True if deletion was successful.
get()
Perform a GET request.
Usage
get(endpoint)Parameters
endpoint: str-
The API endpoint path.
Returns
dict-
Response data.
head()
Perform a HEAD request.
Usage
head(endpoint)Parameters
endpoint: str-
The API endpoint path.
Returns
dict-
Response headers.
options()
Perform an OPTIONS request.
Usage
options(endpoint)Parameters
endpoint: str-
The API endpoint path.
Returns
list-
Allowed methods.
patch()
Perform a PATCH request.
Usage
patch(endpoint, data)Parameters
endpoint: str-
The API endpoint path.
data: dict-
Partial update payload.
Returns
dict-
Response data.
post()
Perform a POST request.
Usage
post(endpoint, data)Parameters
endpoint: str-
The API endpoint path.
data: dict-
Request body payload.
Returns
dict-
Response data.
put()
Perform a PUT request.
Usage
put(endpoint, data)Parameters
endpoint: str-
The API endpoint path.
data: dict-
Request body payload.
Returns
dict-
Response data.