dark Summary web-appcustom-elementelement-attrelement-stateelement-flowglobal-stateimport-elementimport-scriptimport-styleis-visibleis-hiddenrepeat-list trigger-eventlisten-event set-attrset-stateset-timersend-eventhttp-requestrequest-headerrequest-bodyresponse-okresponse-failscripttrigger-element Comparison OperatorsMutation OperatorsData Source
Summary web-appcustom-elementelement-attrelement-stateelement-flowglobal-stateimport-elementimport-scriptimport-styleis-visibleis-hiddenrepeat-list trigger-eventlisten-event set-attrset-stateset-timersend-eventhttp-requestrequest-headerrequest-bodyresponse-okresponse-failscripttrigger-element Comparison OperatorsMutation OperatorsData Source

The http-request action tag is used to send an HTTP request to the server. It is a wrapper of the fetch API with basic features. If you want to use more advanced features, you can use the fetch API directly inside the <script type="module/realm> tag.

The response-ok or response-fail sub-action tag is required to handle the response of the request. If you don’t provide any of them, the request will be ignored.

The URL of the request. The HTTP method of the request, e.g `GET`, `POST`, `PUT`, `DELETE`, etc. The response data type, it can be `json`, `text`, or `html`. Reference link: <request-header> Reference link: <request-body> Reference link: <response-ok> Reference link: <request-fail> See example on Learn HTTP Request page.