Interface IAuWidgetAjaxConfig
Provides properties that are used to send requests to the server and receive responses.
You can use these properties in params of the Au
The following example illustrates how you can populate a gallery with images obtained through an HTTP request.
{
"widgets": [
{
"name": "gallery-images",
"type": "ajax",
"params": {
"lock": "gallery",
"url": "https://example.com/api/images?subfolder=cats",
"method": "GET",
"responseType": "json"
}
}
]
}
Package: ui-framework
Properties
enabled
If false
, the request will not be executed. The default value is true
.
Declaration
enabled: boolean
Property Value
Type | Description |
---|---|
boolean | If |
headers
A dictionary of HTTP headers sent along with the request (an object with the keys used as a header name and a value used as a header value).
Declaration
headers: [key: string]: string
Property Value
Type | Description |
---|---|
[key: string]: string | A dictionary of HTTP headers sent along with the request (an object with the keys used as a header name and a value used as a header value). |
lock
The widget names that should be locked while waiting for the response. The editor will show a preloader on this widget.
Declaration
lock: string[] | string
Property Value
Type | Description |
---|---|
string[] | string | The widget names that should be locked while waiting for the response. The editor will show a preloader on this widget. |
method
An HTTP method like POST
, GET
, etc. The default value is POST
.
Declaration
method: string
Property Value
Type | Description |
---|---|
string | An HTTP method like |
onError
A function ("{{#function <expression>}}")
or an array of functions that should work when the request fails.
Declaration
onError: Function | Array<Function>
Property Value
Type | Description |
---|---|
Function | Array<Function> | A function |
onSuccess
A function ("{{#function <expression>}}")
or an array of functions that work after the successful request.
Declaration
onSuccess: Function | Array<Function>
Property Value
Type | Description |
---|---|
Function | Array<Function> | A function |
request
The request body. Typically, you put a JSON here that consists of references to other widgets.
Declaration
request: any
Property Value
Type | Description |
---|---|
any | The request body. Typically, you put a JSON here that consists of references to other widgets. |
requests
Declaration
requests: Array<any>
Property Value
Type | Description |
---|---|
Array<any> |
responseType
Defines how to interpret the response received from the server.
Declaration
responseType: ResponseType
Property Value
Type | Description |
---|---|
Response |
Defines how to interpret the response received from the server. |
url
A URL that is used to accept requests.
Declaration
url: string
Property Value
Type | Description |
---|---|
string | A URL that is used to accept requests. |