MiddlewareContext

Source
import { MiddlewareContext } from "@prestojs/rest";
MiddlewareContext<T>

API

Constructor

new MiddlewareContext(options)
Source

Arguments:

ArgumentTypeDescription
*options

Methods

addFetchStartListener(callback)
Source

Arguments:

ArgumentTypeDescription
*callback
Returns:
execute()
Source
Returns:Promise
markResponseDecoded(response,decodedBody)
Source

Arguments:

ArgumentTypeDescription
*responseResponse
*decodedBodyPromise
Returns:void
notifyFetchStart(fetchPromise)
Source

Arguments:

ArgumentTypeDescription
*fetchPromisePromise
Returns:void

Properties

executeOptions

Source
An object with these properties:
PropertyTypeDescription
bodynull|BodyInit
cacheRequestCache
credentialsRequestCredentials
headersHeadersInit|Record
integritystring
keepaliveboolean
methodstring
modeRequestMode
paginator|null
redirectRequestRedirect
referrerstring
referrerPolicyReferrerPolicy
signalnull|AbortSignal
windownull
...any
Any properties from UrlResolveOptions

lastState

Source
null|
An object with these properties:
PropertyTypeDescription
*decodedBodyany
*responseResponse
*resultReturnT
*urlstring

requestInit

Source
An object with these properties:
PropertyTypeDescription
bodynull|BodyInit
cacheRequestCache
credentialsRequestCredentials
*headersHeaders
integritystring
keepaliveboolean
*methodstring
modeRequestMode
redirectRequestRedirect
referrerstring
referrerPolicyReferrerPolicy
signalnull|AbortSignal
windownull