Skip to main content

Interface: ImpersRequestInit

Defined in: src/http/fetch.ts:53

impers extension of the standard RequestInit.

Standard Fetch fields (method, headers, body, signal, redirect, integrity, credentials, mode, referrer, referrerPolicy, window, keepalive, duplex) are inherited from RequestInit and not redefined.

The following standard fields are currently ignored: credentials, mode, integrity, keepalive, window, duplex, referrerPolicy, referrer.

maxRedirects defaults to 20 (Fetch standard) rather than impers' usual 30.

Extends

  • RequestInit

Properties

acceptEncoding?

optional acceptEncoding?: string

Defined in: src/http/fetch.ts:103

Accept-Encoding header (default: "gzip, deflate, br")


akamai?

optional akamai?: string

Defined in: src/http/fetch.ts:61

Akamai HTTP/2 fingerprint


auth?

optional auth?: AuthType

Defined in: src/http/fetch.ts:73

HTTP authentication


body?

optional body?: BodyInit | null

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1694

A BodyInit object or null to set request's body.

Inherited from

RequestInit.body


caCert?

optional caCert?: string

Defined in: src/http/fetch.ts:77

CA certificate bundle path


cache?

optional cache?: RequestCache

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1696

A string indicating how the request will interact with the browser's cache to set request's cache.

Inherited from

RequestInit.cache


cert?

optional cert?: string | CertConfig

Defined in: src/http/fetch.ts:79

Client certificate


connectTimeout?

optional connectTimeout?: number

Defined in: src/http/fetch.ts:83

Connection timeout in seconds


cookies?

optional cookies?: CookiesInit

Defined in: src/http/fetch.ts:109

Request cookies


credentials?

optional credentials?: RequestCredentials

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1698

A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.

Inherited from

RequestInit.credentials


curlOptions?

optional curlOptions?: Record<number, unknown>

Defined in: src/http/fetch.ts:111

Raw curl options to set (escape hatch)


decodeContent?

optional decodeContent?: boolean

Defined in: src/http/fetch.ts:105

Decode response content automatically (default: true)


defaultHeaders?

optional defaultHeaders?: boolean

Defined in: src/http/fetch.ts:65

Default headers when impersonating (default: true)


dnsServers?

optional dnsServers?: string[]

Defined in: src/http/fetch.ts:97

DNS servers to use


dohUrl?

optional dohUrl?: string

Defined in: src/http/fetch.ts:99

DNS-over-HTTPS URL


extraFp?

optional extraFp?: ExtraFingerprint

Defined in: src/http/fetch.ts:63

Extra fingerprint options


headers?

optional headers?: HeadersInit

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1700

A Headers object, an object literal, or an array of two-item arrays to set request's headers.

Inherited from

RequestInit.headers


httpVersion?

optional httpVersion?: "2" | "3" | "1.0" | "1.1"

Defined in: src/http/fetch.ts:89

Force specific HTTP version


impersonate?

optional impersonate?: string

Defined in: src/http/fetch.ts:57

Browser to impersonate (e.g. "chrome124", "firefox120")


integrity?

optional integrity?: string

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1702

A cryptographic hash of the resource to be fetched by request. Sets request's integrity.

Inherited from

RequestInit.integrity


interface?

optional interface?: string

Defined in: src/http/fetch.ts:91

Network interface to use


ja3?

optional ja3?: string

Defined in: src/http/fetch.ts:59

JA3 fingerprint string


keepalive?

optional keepalive?: boolean

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1704

A boolean to set request's keepalive.

Inherited from

RequestInit.keepalive


localAddress?

optional localAddress?: string

Defined in: src/http/fetch.ts:93

Local address to bind to


localPort?

optional localPort?: number

Defined in: src/http/fetch.ts:95

Local port to bind to


maxRedirects?

optional maxRedirects?: number

Defined in: src/http/fetch.ts:87

Maximum number of redirects (default: 20, Fetch standard)


method?

optional method?: string

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1706

A string to set request's method.

Inherited from

RequestInit.method


mode?

optional mode?: RequestMode

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1708

A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode.

Inherited from

RequestInit.mode


params?

optional params?: Record<string, string | number | boolean | (string | number | boolean)[]> | URLSearchParams

Defined in: src/http/fetch.ts:55

Query string parameters


priority?

optional priority?: RequestPriority

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1709

Inherited from

RequestInit.priority


proxies?

optional proxies?: ProxyConfig

Defined in: src/http/fetch.ts:69

Protocol-specific proxies


proxy?

optional proxy?: string

Defined in: src/http/fetch.ts:67

Proxy URL (applies to all protocols)


proxyAuth?

optional proxyAuth?: BasicAuth

Defined in: src/http/fetch.ts:71

Proxy authentication


readTimeout?

optional readTimeout?: number

Defined in: src/http/fetch.ts:85

Read timeout in seconds


redirect?

optional redirect?: RequestRedirect

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1711

A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect.

Inherited from

RequestInit.redirect


referer?

optional referer?: string

Defined in: src/http/fetch.ts:107

Referer header


referrer?

optional referrer?: string

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1713

A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer.

Inherited from

RequestInit.referrer


referrerPolicy?

optional referrerPolicy?: ReferrerPolicy

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1715

A referrer policy to set request's referrerPolicy.

Inherited from

RequestInit.referrerPolicy


signal?

optional signal?: AbortSignal | null

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1717

An AbortSignal to set request's signal.

Inherited from

RequestInit.signal


timeout?

optional timeout?: number

Defined in: src/http/fetch.ts:81

Total request timeout in seconds


userAgent?

optional userAgent?: string

Defined in: src/http/fetch.ts:101

User-Agent header


verify?

optional verify?: boolean

Defined in: src/http/fetch.ts:75

Verify SSL certificates (default: true)


window?

optional window?: null

Defined in: docs/node_modules/typescript/lib/lib.dom.d.ts:1719

Can only be null. Used to disassociate request from any Window.

Inherited from

RequestInit.window