Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebResource

Package version

Creates a new WebResource object.

This class provides an abstraction over a REST call by being library / implementation agnostic and wrapping the necessary properties to initiate a request.

Hierarchy

  • WebResource

Implements

Index

Constructors

constructor

  • new WebResource(url?: undefined | string, method?: HttpMethods, body?: unknown, query?: undefined | {}, headers?: {} | HttpHeadersLike, streamResponseBody?: undefined | false | true, withCredentials?: undefined | false | true, abortSignal?: AbortSignalLike, timeout?: undefined | number, onUploadProgress?: undefined | ((progress: TransferProgressEvent) => void), onDownloadProgress?: undefined | ((progress: TransferProgressEvent) => void), proxySettings?: ProxySettings, keepAlive?: undefined | false | true, decompressResponse?: undefined | false | true): WebResource

Properties

Optional abortSignal

abortSignal: AbortSignalLike

Optional body

body: any

Optional decompressResponse

decompressResponse: undefined | false | true

Whether or not to decompress response according to Accept-Encoding header (node-fetch only)

Optional formData

formData: any

headers

Optional keepAlive

keepAlive: undefined | false | true

method

method: HttpMethods

Optional onDownloadProgress

onDownloadProgress: undefined | ((progress: TransferProgressEvent) => void)

Callback which fires upon download progress.

Optional onUploadProgress

onUploadProgress: undefined | ((progress: TransferProgressEvent) => void)

Callback which fires upon upload progress.

Optional operationResponseGetter

operationResponseGetter: undefined | ((operationSpec: OperationSpec, response: HttpOperationResponse) => undefined | OperationResponse)

A function that returns the proper OperationResponse for the given OperationSpec and HttpOperationResponse combination. If this is undefined, then a simple status code lookup will be used.

Optional operationSpec

operationSpec: OperationSpec

Optional proxySettings

proxySettings: ProxySettings

Optional query

query: undefined | {}

requestId

requestId: string

Optional shouldDeserialize

shouldDeserialize: boolean | ((response: HttpOperationResponse) => boolean)

Whether or not the HttpOperationResponse should be deserialized. If this is undefined, then the HttpOperationResponse should be deserialized.

Optional spanOptions

spanOptions: SpanOptions

Options used to create a span when tracing is enabled.

Optional streamResponseBody

streamResponseBody: undefined | false | true

Whether or not the body of the HttpOperationResponse should be treated as a stream.

timeout

timeout: number

url

url: string

withCredentials

withCredentials: boolean

Methods

clone

prepare

validateRequestProperties

  • validateRequestProperties(): void

Generated using TypeDoc