Skip to main content
Version: Next

HttpRequestOptions <TResponseType>

Additional options for HTTP requests that need to be handled separately before passing to BaseHttpClient.

Hierarchy

Index

Properties

optionalinheritedbody

body?: string | Readable | Buffer | Generator<unknown, any, any> | AsyncGenerator<unknown, any, any> | FormDataLike

optionalinheritedcookieJar

cookieJar?: ToughCookieJar | PromiseCookieJar

optionalinheritedencoding

encoding?: BufferEncoding

optionalinheritedfollowRedirect

followRedirect?: boolean | (response: any) => boolean

optionalform

form?: Record<string, string>

A form to be sent in the HTTP request body (URL encoding will be used)

optionalinheritedheaderGenerator

headerGenerator?: { getHeaders: (options: Record<string, unknown>) => Record<string, string> }

Type declaration

  • getHeaders: (options: Record<string, unknown>) => Record<string, string>
      • (options: Record<string, unknown>): Record<string, string>
      • Parameters

        • options: Record<string, unknown>

        Returns Record<string, string>

optionalinheritedheaderGeneratorOptions

headerGeneratorOptions?: Record<string, unknown>

optionalinheritedheaders

headers?: SimpleHeaders

optionalinheritedinsecureHTTPParser

insecureHTTPParser?: boolean

optionaljson

json?: unknown

Artbitrary object to be JSON-serialized and sent as the HTTP request body

optionalinheritedmaxRedirects

maxRedirects?: number

optionalinheritedmethod

method?: Method

optionalpassword

password?: string

Basic HTTP Auth password

optionalinheritedproxyUrl

proxyUrl?: string

optionalinheritedresponseType

responseType?: TResponseType

optionalsearchParams

searchParams?: SearchParams

Search (query string) parameters to be appended to the request URL

optionalinheritedsessionToken

sessionToken?: object

optionalinheritedsignal

signal?: AbortSignal

optionalinheritedthrowHttpErrors

throwHttpErrors?: boolean

optionalinheritedtimeout

timeout?: Partial<Timeout>

inheritedurl

url: string | URL

optionalinheriteduseHeaderGenerator

useHeaderGenerator?: boolean

optionalusername

username?: string

Basic HTTP Auth username