code-docs/plugins/connections/axios-http.md
HTTP/REST API connection for Lowdefy using Axios.
| Type | Purpose |
|---|---|
AxiosHttp | Connect to HTTP/REST APIs |
connections:
- id: api
type: AxiosHttp
properties:
baseUrl: https://api.example.com
headers:
Authorization:
_string:
- 'Bearer '
- _secret: API_TOKEN
| Property | Type | Description |
|---|---|---|
baseUrl | string | Base URL for requests |
headers | object | Default headers |
timeout | number | Request timeout (ms) |
auth | object | Basic auth credentials |
| Type | Purpose |
|---|---|
AxiosHttp | Make HTTP request |
requests:
- id: getUsers
type: AxiosHttp
connectionId: api
properties:
url: /users
method: GET
params:
page:
_state: page
limit: 20
| Property | Type | Description |
|---|---|---|
url | string | Request URL (appended to baseUrl) |
method | string | HTTP method (GET, POST, PUT, DELETE, PATCH) |
params | object | URL query parameters |
data | any | Request body |
headers | object | Request-specific headers |
timeout | number | Override connection timeout |
responseType | string | Expected response type |
requests:
- id: fetchData
type: AxiosHttp
connectionId: api
properties:
url: /items
method: GET
params:
search:
_state: searchQuery
requests:
- id: createItem
type: AxiosHttp
connectionId: api
properties:
url: /items
method: POST
data:
name:
_state: name
description:
_state: description
requests:
- id: updateItem
type: AxiosHttp
connectionId: api
properties:
url:
_string:
- '/items/'
- _state: itemId
method: PUT
data:
_state: formData
requests:
- id: deleteItem
type: AxiosHttp
connectionId: api
properties:
url:
_string:
- '/items/'
- _state: itemId
method: DELETE
requests:
- id: uploadFile
type: AxiosHttp
connectionId: api
properties:
url: /upload
method: POST
headers:
Content-Type: multipart/form-data
data:
file:
_state: fileInput
requests:
- id: authenticatedRequest
type: AxiosHttp
connectionId: api
properties:
url: /protected
method: GET
headers:
X-Custom-Header: value
Authorization:
_string:
- 'Bearer '
- _user: accessToken
The response includes:
data - Response bodystatus - HTTP status codeheaders - Response headersAccess in state:
_request: getUsers.data
HTTP errors throw RequestError with:
Handle in actions:
events:
onClick:
- id: fetch
type: Request
params:
requestId: getUsers
onError:
- id: showError
type: Message
params:
content: Request failed
type: error