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
Constructor for RestAdapter
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
FloweryAPIConfig
|
Configuration object for the FloweryAPI class |
FloweryAPIConfig
|
Raises:
Type | Description |
---|---|
ValueError
|
Raised when the keyword arguments passed to the class constructor conflict. |
Source code in pyflowery/rest_adapter.py
get(endpoint, 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 |
str
|
The endpoint to make the request to. |
required |
params |
dict
|
Python dictionary of query parameters to send with the request. |
None
|
timeout |
float
|
Number of seconds to wait for the request to complete. |
60
|
Raises:
Type | Description |
---|---|
TooManyRequests
|
Raised when the Flowery API returns a 429 status code |
ClientError
|
Raised when the Flowery API returns a 4xx status code |
InternalServerError
|
Raised when the Flowery API returns a 5xx status code |
RetryLimitExceeded
|
Raised when the retry limit defined in the |
Returns:
Name | Type | Description |
---|---|---|
Result |
Result | None
|
A Result object containing the status code, message, and data from the request. |