Skip to main content
Version: 3.12

HttpRequestOptions <TResponseType>

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

Hierarchy

Index

Properties

optionalbody

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

optionalcookieJar

cookieJar?: ToughCookieJar | PromiseCookieJar

optionalencoding

encoding?: BufferEncoding

optionalfollowRedirect

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)

optionalheaderGenerator

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>

optionalheaderGeneratorOptions

headerGeneratorOptions?: Record<string, unknown>

optionalheaders

headers?: SimpleHeaders

optionalinsecureHTTPParser

insecureHTTPParser?: boolean

optionaljson

json?: unknown

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

optionalmaxRedirects

maxRedirects?: number

optionalmethod

method?: Method

optionalpassword

password?: string

Basic HTTP Auth password

optionalproxyUrl

proxyUrl?: string

optionalresponseType

responseType?: TResponseType

optionalsearchParams

searchParams?: SearchParams

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

optionalsessionToken

sessionToken?: object

optionalsignal

signal?: AbortSignal

optionalthrowHttpErrors

throwHttpErrors?: boolean

optionaltimeout

timeout?: Partial<Timeout>

url

url: string | URL

optionaluseHeaderGenerator

useHeaderGenerator?: boolean

optionalusername

username?: string

Basic HTTP Auth username