Api calls
api_request(api_url, json=None)
Sends an HTTP GET or POST request to the specified API URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_url
|
str
|
The URL of the API endpoint. |
required |
json
|
dict | None
|
The JSON payload for a POST request (None for GET requests). |
None
|
Returns:
Name | Type | Description |
---|---|---|
response |
list | dict
|
The JSON response from the API, or an empty list if an error occurs. |
Source code in app/ui/utils/api_calls.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|