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-error → Request

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

request-started #

at-request-started → Request

Fired when a request is sent.

request-aborted #

at-request-aborted → Request

Fired when a request was canceled.

response-raw #

at-response-raw → Object

Fired when a response is received.

response #

at-response → Object

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-error → CustomEvent



response-error-raw #

at-response-error-raw → Object

Fired when a error has occoured.

response-error #

at-response-error → Object

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-4xx → Object

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-5xx → Object

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