Rest Adapter¶
Internal Functions
These functions are meant for use in other parts of the module. You probably shouldn't be calling these manually.
If there's an endpoint method missing from the main FloweryAPI class, you should open an issue (or a pull request).
This module contains the RestAdapter class, which is used to make requests to the Flowery API.
RestAdapter
¶
Underlying class for making HTTP requests.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
|
Configuration object for the FloweryAPI class. |
required |
get(endpoint, data=None, headers=None, params=None, timeout=60)
async
¶
Make a GET request to the Flowery API. You should almost never have to use this directly.
If you need to use this method because an endpoint is missing, please open an issue on the CoastalCommits repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
endpoint
|
|
The endpoint to make the request to. |
required |
data
|
|
The request body. |
None
|
headers
|
|
Headers to send with the request. Note that |
None
|
params
|
|
Query parameters to send with the request. |
None
|
timeout
|
|
Number of seconds to wait for the request to complete. |
60
|
Raises:
| Type | Description |
|---|---|
|
Raised when the Flowery API returns a 429 status code |
|
Raised when the Flowery API returns a 4xx status code |
|
Raised when the Flowery API returns a 5xx status code |
|
Raised when the retry limit defined in the [ |
Returns:
| Type | Description |
|---|---|
|
An object containing the status code, message, and data from the request. |
post(endpoint, data=None, headers=None, params=None, timeout=60)
async
¶
Make a POST request to the Flowery API. You should almost never have to use this directly.
If you need to use this method because an endpoint is missing, please open an issue on the CoastalCommits repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
endpoint
|
|
The endpoint to make the request to. |
required |
data
|
|
The request body. |
None
|
headers
|
|
Headers to send with the request. Note that |
None
|
params
|
|
Query parameters to send with the request. |
None
|
timeout
|
|
Number of seconds to wait for the request to complete. |
60
|
Raises:
| Type | Description |
|---|---|
|
Raised when the Flowery API returns a 429 status code |
|
Raised when the Flowery API returns a 4xx status code |
|
Raised when the Flowery API returns a 5xx status code |
|
Raised when the retry limit defined in the [ |
Returns:
| Type | Description |
|---|---|
|
An object containing the status code, message, and data from the request. |