Endpoint
Sourceimport { Endpoint } from "@prestojs/rest";
Endpoint<ReturnT = any>
Constructor
Arguments:
Argument | Type | Description | |
---|---|---|---|
* | urlPattern | string|UrlPattern | |
options An object with the properties below | |||
options.baseUrl | string | ||
options.body | null|BodyInit | ||
options.cache | RequestCache | ||
options.credentials | RequestCredentials | ||
options.decodeBody | |||
options.getMiddleware | |||
options.headers | HeadersInit|Record | ||
options.integrity | string | ||
options.keepalive | boolean | ||
options.method | string | ||
options.middleware | (|)[] | ||
options.mode | RequestMode | ||
options.paginator | |null | ||
options.redirect | RequestRedirect | ||
options.referrer | string | ||
options.referrerPolicy | ReferrerPolicy | ||
options.resolveUrl | |||
options.signal | null|AbortSignal | ||
options.window | null |
Methods
Arguments:
Argument | Type | Description | |
---|---|---|---|
options An object with the properties below | |||
options.body | null|BodyInit | ||
options.cache | RequestCache | ||
options.credentials | RequestCredentials | ||
options.headers | HeadersInit|Record | ||
options.integrity | string | ||
options.keepalive | boolean | ||
options.method | string | ||
options.mode | RequestMode | ||
options.paginator | |null | ||
options.redirect | RequestRedirect | ||
options.referrer | string | ||
options.referrerPolicy | ReferrerPolicy | ||
options.signal | null|AbortSignal | ||
options.window | null | ||
... | any | Any properties from UrlResolveOptions |
Returns:Promise
Returns:null|
Arguments:
Argument | Type | Description | |
---|---|---|---|
options An object with the properties below | |||
options.body | null|BodyInit | ||
options.cache | RequestCache | ||
options.credentials | RequestCredentials | ||
options.headers | HeadersInit|Record | ||
options.integrity | string | ||
options.keepalive | boolean | ||
options.method | string | ||
options.mode | RequestMode | ||
options.paginator | |null | ||
options.redirect | RequestRedirect | ||
options.referrer | string | ||
options.referrerPolicy | ReferrerPolicy | ||
options.signal | null|AbortSignal | ||
options.window | null | ||
... | any | Any properties from UrlResolveOptions |
Returns:
An object with these properties: | |||
---|---|---|---|
Property | Type | Description | |
* | endpoint | Endpoint | |
* | execute | Deprecated: | |
* | options | ||
* | urlResolveOptions | UrlResolveOptions |
Arguments:
Argument | Type | Description | |
---|---|---|---|
* | urlPattern | UrlPattern | |
* | urlArgs | Record | |
* | query | undefined|QueryStringParams | |
* | baseUrl | string |
Returns:string
Properties
requestInit
SourceAn object with these properties: | |||
---|---|---|---|
Property | Type | Description | |
body | null|BodyInit | ||
cache | RequestCache | ||
credentials | RequestCredentials | ||
headers | HeadersInit|Record | ||
integrity | string | ||
keepalive | boolean | ||
method | string | ||
mode | RequestMode | ||
paginator | |null | ||
redirect | RequestRedirect | ||
referrer | string | ||
referrerPolicy | ReferrerPolicy | ||
signal | null|AbortSignal | ||
window | null |
Static Properties
defaultConfig
SourceAn object with these properties: | |||
---|---|---|---|
Property | Type | Description | |
* | baseUrl | string | |
* | getMiddleware | ||
* | middleware | (|)[] | |
* | requestInit | RequestInit |