furo-api-fetch

furo-api-fetch #

@furo/data v2.18.0
import '@furo/data/src/furo-api-fetch.js';
exports FuroApiFetch js
exports <furo-api-fetch> custom-element-definition
superclass HTMLElement

summary fetch data from network

Use furo-api-fetch to fetch data from the network.

1
<furo-api-fetch fn-invoke-request="--Request"></furo-api-fetch>

Attributes and Properties #

lastRequest #

default: {}

LastRequest’s response.

Note that lastResponse is set when ongoing request finishes, so if loading is true, then lastResponse will correspond to the result of the previous request.

isLoading #

default: false

True while request is in flight.

Events #

fatal-error #

at-fatal-errorRequest

Requests are made via the Fetch API if possible.Fallback XMLHttpRequest

request-started #

at-request-startedRequest

Fired when a request is sent.

request-aborted #

at-request-abortedRequest

Fired when a request was canceled.

response-raw #

at-response-rawObject

Fired when a response is received.

response #

at-responseObject

Fired when a response is received. Here you will get the parsed response Format depends on request header content-type supported types: - text/plain - application/json - image/jpeg (Blob) - application/octet-stream (ArrayBuffer) - application/pdf (Blob)

parse-error #

at-parse-errorCustomEvent



response-error-raw #

at-response-error-rawObject

Fired when a error has occoured.

response-error #

at-response-errorObject

Fired when an error has occoured. This is a general error event. The specific error events are fired additionally.

**** #

at-CustomEvent



response-error-[status-code] #

at-response-error-[status-code]Object

Fired when an error has occoured. This is a specific error event.

response-error-4xx #

at-response-error-4xxObject

Fired when an error has occoured. This is a group error event. E.g. response-error-5xx, response-error-4xx

response-error-5xx #

at-response-error-5xxObject

Fired when an error has occoured. This is a group error event. E.g. response-error-5xx, response-error-4xx

Methods #

invokeRequest #

invokeRequest(request Request ) ⟹ void

Request fn-invoke-request

Sends a HTTP request to the server

abortRequest #

abortRequest(controller AbortController ) ⟹ void

AbortController fn-abort-request

Aborts a pending request You have to submit an AbortController