Skip to content

Latest commit

 

History

History
2336 lines (1191 loc) · 50.5 KB

api.md

File metadata and controls

2336 lines (1191 loc) · 50.5 KB

Fetch Toolkit API Reference

Classes

fetch-toolkitDocs


fetch-toolkit / API

Class: API

Represents an API client that makes HTTP requests to a specified base URL.

Constructors

new API()

new API(baseUrl, authentication?, maxParallel?, logger?, customDecorators?): API

Creates an instance of the API client.

Parameters

baseUrl: string

The base URL of the API.

authentication?: AuthenticationProvider

Optional authentication provider for the API (see AuthenticationProvider)

maxParallel?: number

Optional maximum number of parallel requests to be handled. If not provided, no limit is set.

logger?: FetchLogger

Optional logger for the API (see FetchLogger)

customDecorators?: FetchDecorator[]

Optional custom decorators for the API (see FetchDecorator)

Returns

API

Source

src/api.ts:37

Properties

authentication?

optional authentication: AuthenticationProvider

Optional authentication provider for the API (see AuthenticationProvider)

Source

src/api.ts:39


baseUrl

readonly baseUrl: string

The base URL of the API.

Source

src/api.ts:38


customDecorators?

optional customDecorators: FetchDecorator[]

Optional custom decorators for the API (see FetchDecorator)

Source

src/api.ts:42


groupHandler?

optional groupHandler: FetchGroupHandler

The handler for managing parallel requests (optional). See FetchGroupHandler.

Source

src/api.ts:27


logger?

optional logger: FetchLogger

Optional logger for the API (see FetchLogger)

Source

src/api.ts:41

Methods

call()

call<T>(method, endpoint, params?, body?): Promise<T>

Makes an HTTP request to the API. The method returns the defined return type. Please note that no validation is done on the return type.

Type parameters

T

Parameters

method: HttpMethod

The HTTP method of the request.

endpoint: string

The endpoint of the request.

params?: any

The query parameters of the request.

body?: unknown

The body of the request.

Returns

Promise<T>

A promise that resolves to the defined return.

Source

src/api.ts:58


delete()

delete<T>(endpoint, params?, body?): Promise<T>

Makes a DELETE request to the API. The method returns the defined return type. Please note that no validation is done on the return type.

Type parameters

T

Parameters

endpoint: string

The endpoint of the request.

params?: any

The query parameters of the request.

body?: unknown

The body of the request.

Returns

Promise<T>

A promise that resolves to the response data.

Source

src/api.ts:110


get()

get<T>(endpoint, params?): Promise<T>

Makes a GET request to the API. The method returns the defined return type. Please note that no validation is done on the return type.

Type parameters

T

Parameters

endpoint: string

The endpoint of the request.

params?: any

The query parameters of the request.

Returns

Promise<T>

A promise that resolves to the response data.

Source

src/api.ts:98


patch()

patch<T>(endpoint, body, params?): Promise<T>

Makes a PATCH request to the API. The method returns the defined return type. Please note that no validation is done on the return type.

Type parameters

T

Parameters

endpoint: string

The endpoint of the request.

body: unknown

The body of the request.

params?: any

The query parameters of the request.

Returns

Promise<T>

A promise that resolves to the response data.

Source

src/api.ts:122


post()

post<T>(endpoint, body, params?): Promise<T>

Makes a POST request to the API. The method returns the defined return type. Please note that no validation is done on the return type.

Type parameters

T

Parameters

endpoint: string

The endpoint of the request.

body: unknown

The body of the request.

params?: any

The query parameters of the request.

Returns

Promise<T>

A promise that resolves to the response data.

Source

src/api.ts:134


put()

put<T>(endpoint, body, params?): Promise<T>

Makes a PUT request to the API. The method returns the defined return type. Please note that no validation is done on the return type.

Type parameters

T

Parameters

endpoint: string

The endpoint of the request.

body: unknown

The body of the request.

params?: any

The query parameters of the request.

Returns

Promise<T>

A promise that resolves to the response data.

Source

src/api.ts:146

fetch-toolkitDocs


fetch-toolkit / AuthenticationProvider

Class: abstract AuthenticationProvider

Base class for authentication providers.

Extended by

Implements

Constructors

new AuthenticationProvider()

new AuthenticationProvider(): AuthenticationProvider

Returns

AuthenticationProvider

Methods

decorateRequest()

decorateRequest(_url, init): Promise<void>

Decorate the request with the Authorization header.

Parameters

_url: string

URL to decorate. Irrelevant for this implementation

init: RequestInit

Fetch options

Returns

Promise<void>

Implementation of

FetchDecorator.decorateRequest

Source

src/authentication.ts:15


getHeaderValue()

protected abstract getHeaderValue(): string | Promise<string>

Get the value of the Authorization header.

Returns

string | Promise<string>

Source

src/authentication.ts:25

fetch-toolkitDocs


fetch-toolkit / BasicAuthenticationProvider

Class: BasicAuthenticationProvider

Implements the Basic authentication provider. The Basic authentication provider uses a username and password to authenticate. The username and password are encoded in base64 and sent in the Authorization header.

Extends

Constructors

new BasicAuthenticationProvider()

new BasicAuthenticationProvider(username, password): BasicAuthenticationProvider

Constructor.

Parameters

username: string

Username

password: string

Password

Returns

BasicAuthenticationProvider

Overrides

AuthenticationProvider.constructor

Source

src/authentication.ts:40

Properties

password

password: string

Password

Source

src/authentication.ts:40


username

username: string

Username

Source

src/authentication.ts:40

Methods

decorateRequest()

decorateRequest(_url, init): Promise<void>

Decorate the request with the Authorization header.

Parameters

_url: string

URL to decorate. Irrelevant for this implementation

init: RequestInit

Fetch options

Returns

Promise<void>

Inherited from

AuthenticationProvider.decorateRequest

Source

src/authentication.ts:15


getHeaderValue()

protected getHeaderValue(): string

Get the value of the Authorization header.

Returns

string

Overrides

AuthenticationProvider.getHeaderValue

Source

src/authentication.ts:47

fetch-toolkitDocs


fetch-toolkit / BearerAuthenticationProvider

Class: BearerAuthenticationProvider

Implements the Bearer authentication provider. The Bearer authentication provider uses a token to authenticate. The token is sent in the Authorization header.

Extends

Constructors

new BearerAuthenticationProvider()

new BearerAuthenticationProvider(token, prefix): BearerAuthenticationProvider

Constructor.

Parameters

token: string | () => string | Promise<string>

Token or function that returns a token

prefix: string= "Bearer"

Prefix for the authorization header. Default is "Bearer"

Returns

BearerAuthenticationProvider

Overrides

AuthenticationProvider.constructor

Source

src/authentication.ts:67

Properties

prefix

prefix: string = "Bearer"

Prefix for the authorization header. Default is "Bearer"

Source

src/authentication.ts:67


token

token: string | () => string | Promise<string>

Token or function that returns a token

Source

src/authentication.ts:67

Methods

decorateRequest()

decorateRequest(_url, init): Promise<void>

Decorate the request with the Authorization header.

Parameters

_url: string

URL to decorate. Irrelevant for this implementation

init: RequestInit

Fetch options

Returns

Promise<void>

Inherited from

AuthenticationProvider.decorateRequest

Source

src/authentication.ts:15


getHeaderValue()

protected getHeaderValue(): Promise<string>

Set the value of the Authorization header to the token. If the token is a function, call it to get the token. Otherwise, use the token as is. Exceptions are not handled here. If the token is a function and it throws an exception, it will be propagated.

Returns

Promise<string>

Value of the Authorization header

Overrides

AuthenticationProvider.getHeaderValue

Source

src/authentication.ts:78

fetch-toolkitDocs


fetch-toolkit / FetchConsoleLogger

Class: FetchConsoleLogger

A logger that logs to the console.

Extends

Constructors

new FetchConsoleLogger()

new FetchConsoleLogger(logBody, logHeaders): FetchConsoleLogger

Parameters

logBody: boolean= false

logHeaders: boolean= false

Returns

FetchConsoleLogger

Overrides

FetchLogger.constructor

Inherit Doc
Source

src/logging.ts:131

Properties

logBody

protected logBody: boolean = false

Log the body of the request.

Inherited from

FetchLogger.logBody

Source

src/logging.ts:14


logHeaders

protected logHeaders: boolean = false

Log the headers of the request.

Inherited from

FetchLogger.logHeaders

Source

src/logging.ts:14

Methods

decorateRequest()

decorateRequest(url, request): void

Decorates the request with logging.

Parameters

url: string

URL to decorate.

request: RequestInitToolkit

Fetch options.

Returns

void

void

Inherited from

FetchLogger.decorateRequest

Source

src/logging.ts:23


decorateResponse()

decorateResponse(_url, request, response): void

Decorates the response with logging.

Parameters

_url: string

URL to decorate (not used in this implementation)

request: RequestInitToolkit

Fetch options.

response: Response

Fetch response.

Returns

void

void

Inherited from

FetchLogger.decorateResponse

Source

src/logging.ts:75


logAction()

protected logAction(logStr): void

Logs the action to the console as debug.

Parameters

logStr: string

The string to log.

Returns

void

Overrides

FetchLogger.logAction

Source

src/logging.ts:139


logAdditionalAction()

static logAdditionalAction(message, request?): void

Helper method to log an additional action performed by the fetching process which is not a request or response.

Parameters

message: string

Message to log.

request?: RequestInitToolkit

Fetch options.

Returns

void

Inherited from

FetchLogger.logAdditionalAction

Source

src/logging.ts:101

fetch-toolkitDocs


fetch-toolkit / FetchError

Class: FetchError

Error thrown on a faulty fetch request

Extends

  • Error

Constructors

new FetchError()

new FetchError(url, status, statusText, responseText?): FetchError

Parameters

url: string

status: number

statusText: string

responseText?: string

Returns

FetchError

Overrides

Error.constructor

Source

src/types.ts:7

Properties

message

message: string

Inherited from

Error.message

Source

node_modules/typescript/lib/lib.es5.d.ts:1054


name

name: string

Inherited from

Error.name

Source

node_modules/typescript/lib/lib.es5.d.ts:1053


responseText?

optional readonly responseText: string

Source

src/types.ts:11


stack?

optional stack: string

Inherited from

Error.stack

Source

node_modules/typescript/lib/lib.es5.d.ts:1055


status

readonly status: number

Source

src/types.ts:9


statusText

readonly statusText: string

Source

src/types.ts:10


url

readonly url: string

Source

src/types.ts:8


prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

Inherited from

Error.prepareStackTrace

Source

node_modules/@types/node/globals.d.ts:28


stackTraceLimit

static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Source

node_modules/@types/node/globals.d.ts:30

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

Error.captureStackTrace

Source

node_modules/@types/node/globals.d.ts:21

fetch-toolkitDocs


fetch-toolkit / FetchGroupHandler

Class: FetchGroupHandler

Handles fetching requests that share a context with a maximum number of parallel requests.

Extends

Constructors

new FetchGroupHandler()

new FetchGroupHandler(maxParallel): FetchGroupHandler

Creates an instance of FetchGroupHandler.

Parameters

maxParallel: number

The maximum number of parallel requests to handle.

Returns

FetchGroupHandler

Overrides

FetchHandler.constructor

Source

src/group.ts:21

Properties

maxParallel

readonly maxParallel: number

The maximum number of parallel requests to handle.

Source

src/group.ts:21

Accessors

numberOfExecuting

get numberOfExecuting(): number

Returns the number of the executing fetch requests

Returns

number

Source

src/group.ts:81


waitingQueueLength

get waitingQueueLength(): number

Returns the length of the waiting queue

Returns

number

Source

src/group.ts:74

Methods

fetch()

fetch(url, init?): Promise<Response>

Fetches a resource from the specified URL.

Parameters

url: string

The URL of the resource to fetch.

init?: RequestInitToolkit

The optional request initialization options.

Returns

Promise<Response>

A Promise that resolves to the Response object representing the fetched resource.

Overrides

FetchHandler.fetch

Source

src/group.ts:50

fetch-toolkitDocs


fetch-toolkit / FetchGroupHandlerError

Class: FetchGroupHandlerError

Represents an error that can occur in the FetchGroupHandler class.

Extends

  • Error

Constructors

new FetchGroupHandlerError()

new FetchGroupHandlerError(message?): FetchGroupHandlerError

Parameters

message?: string

Returns

FetchGroupHandlerError

Inherited from

Error.constructor

Source

node_modules/typescript/lib/lib.es5.d.ts:1059

Properties

message

message: string

Inherited from

Error.message

Source

node_modules/typescript/lib/lib.es5.d.ts:1054


name

name: string

Inherited from

Error.name

Source

node_modules/typescript/lib/lib.es5.d.ts:1053


stack?

optional stack: string

Inherited from

Error.stack

Source

node_modules/typescript/lib/lib.es5.d.ts:1055


prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

Inherited from

Error.prepareStackTrace

Source

node_modules/@types/node/globals.d.ts:28


stackTraceLimit

static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Source

node_modules/@types/node/globals.d.ts:30

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

Error.captureStackTrace

Source

node_modules/@types/node/globals.d.ts:21

fetch-toolkitDocs


fetch-toolkit / FetchHandler

Class: abstract FetchHandler

A class that handles the call to the fetch api itself. Use it if just implementing decorators is not enough

Extended by

Constructors

new FetchHandler()

new FetchHandler(): FetchHandler

Returns

FetchHandler

Methods

fetch()

abstract fetch(url, init?): Promise<Response>

Parameters

url: string

init?: RequestInit

Returns

Promise<Response>

Source

src/types.ts:29

fetch-toolkitDocs


fetch-toolkit / FetchLogger

Class: abstract FetchLogger

Base class for logging decorators.

Extended by

Implements

Constructors

new FetchLogger()

new FetchLogger(logBody, logHeaders): FetchLogger

Constructor.

Parameters

logBody: boolean= false

Log the body of the request.

logHeaders: boolean= false

Log the headers of the request.

Returns

FetchLogger

Source

src/logging.ts:14

Properties

logBody

protected logBody: boolean = false

Log the body of the request.

Source

src/logging.ts:14


logHeaders

protected logHeaders: boolean = false

Log the headers of the request.

Source

src/logging.ts:14

Methods

decorateRequest()

decorateRequest(url, request): void

Decorates the request with logging.

Parameters

url: string

URL to decorate.

request: RequestInitToolkit

Fetch options.

Returns

void

void

Implementation of

FetchDecorator.decorateRequest

Source

src/logging.ts:23


decorateResponse()

decorateResponse(_url, request, response): void

Decorates the response with logging.

Parameters

_url: string

URL to decorate (not used in this implementation)

request: RequestInitToolkit

Fetch options.

response: Response

Fetch response.

Returns

void

void

Implementation of

FetchDecorator.decorateResponse

Source

src/logging.ts:75


logAction()

protected abstract logAction(logStr, action): void

Logs an action. Must be implemented by the child class.

Parameters

logStr: string

The string to log.

action: "Request" | "Response" | "Additional" | "Body" | "Header"

The type of action to log.

Returns

void

Source

src/logging.ts:118


logAdditionalAction()

static logAdditionalAction(message, request?): void

Helper method to log an additional action performed by the fetching process which is not a request or response.

Parameters

message: string

Message to log.

request?: RequestInitToolkit

Fetch options.

Returns

void

Source

src/logging.ts:101

fetch-toolkitDocs


fetch-toolkit / PromiseConcurrentQueue

Class: PromiseConcurrentQueue<T>

Class to handle a queue of promises that are executed concurrently

Type parameters

T

Constructors

new PromiseConcurrentQueue()

new PromiseConcurrentQueue<T>(maxParallel, onEventCallback?): PromiseConcurrentQueue<T>

Creates an instance of the PromiseConcurrentQueue

Parameters

maxParallel: number

The maximum number of parallel promises that can be executed. If not set, no limit is set.

onEventCallback?: OnEventCallback

Optional callback to be triggered when an event occurs

Returns

PromiseConcurrentQueue<T>

Source

src/parallel-promise-handler.ts:67

Properties

maxParallel

readonly maxParallel: number

The maximum number of parallel promises that can be executed. If not set, no limit is set.

Source

src/parallel-promise-handler.ts:67


onEventCallback?

optional onEventCallback: OnEventCallback

Optional callback to be triggered when an event occurs

Source

src/parallel-promise-handler.ts:67

Accessors

numberOfExecuting

get numberOfExecuting(): number

Returns the number of the executing promises

Returns

number

Source

src/parallel-promise-handler.ts:223


waitingQueueLength

get waitingQueueLength(): number

Returns the length of the waiting queue

Returns

number

Source

src/parallel-promise-handler.ts:216

Methods

push()

push(func, uid?, data?): Promise<T>

Pushes a new function to the queue

Parameters

func

Function to be executed

uid?: string

Optional unique identifier for the function. If not set, a new one is generated

data?: unknown

Data passed to the callback function

Returns

Promise<T>

Returns a promise that resolves to the result of the function

Source

src/parallel-promise-handler.ts:76

Functions

fetch-toolkitDocs


fetch-toolkit / fetchJson

Function: fetchJson()

fetchJson<T>(url, init?): Promise<T>

Helper method to get a response as JSON. Throws a FetchError in case of faulty Status code

Type parameters

T

Parameters

url: string

URL to retrievce

init?: RequestInitToolkit

Init parameters (same as used in the native fetch command)

Returns

Promise<T>

A JSON object

Source

src/fetch-toolkit.ts:11

fetch-toolkitDocs


fetch-toolkit / fetchSetHeader

Function: fetchSetHeader()

fetchSetHeader(init, headerName, headerValue, overwrite?): RequestInit

Helper method to set a header in the fetch request. It checks if the header has the has and set methods and uses them if available. If the header does not have the has and set methods, it uses the header as a dictionary. If the header already exists, it overwrites the value if the overwrite parameter is true. If the header does not exist, it creates it.

Parameters

init: undefined | RequestInitToolkit

Request options

headerName: string

Header name

headerValue: string

Header value

overwrite?: boolean

If true, it overwrites the header value if it already exists

Returns

RequestInit

The updated init object

Source

src/fetch-toolkit.ts:106

fetch-toolkitDocs


fetch-toolkit

Classes

Interfaces

Type Aliases

Variables

Functions

Interfaces

fetch-toolkitDocs


fetch-toolkit / FetchDecorator

Interface: FetchDecorator

Base interface for the decorating a fetch request and response

Properties

decorateRequest()?

optional decorateRequest: (url, request) => void | Promise<void>

Parameters

url: string

request: RequestInitToolkit

Returns

void | Promise<void>

Source

src/types.ts:21


decorateResponse()?

optional decorateResponse: (url, request, response) => void | Promise<void>

Parameters

url: string

request: RequestInitToolkit

response: Response

Returns

void | Promise<void>

Source

src/types.ts:22

fetch-toolkitDocs


fetch-toolkit / RequestInitToolkit

Interface: RequestInitToolkit

Toolkit extension for the fetch options

Extends

  • RequestInit

Properties

body?

optional body: null | BodyInit

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

Inherited from

RequestInit.body

Source

node_modules/typescript/lib/lib.dom.d.ts:1591


cache?

optional cache: RequestCache

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

Inherited from

RequestInit.cache

Source

node_modules/typescript/lib/lib.dom.d.ts:1593


credentials?

optional credentials: RequestCredentials

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

Source

node_modules/typescript/lib/lib.dom.d.ts:1595


decorators?

optional decorators: FetchDecorator[]

Source

src/types.ts:36


handler?

optional handler: FetchHandler

Source

src/types.ts:37


headers?

optional headers: HeadersInit

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

Inherited from

RequestInit.headers

Source

node_modules/typescript/lib/lib.dom.d.ts:1597


integrity?

optional integrity: string

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

Inherited from

RequestInit.integrity

Source

node_modules/typescript/lib/lib.dom.d.ts:1599


keepalive?

optional keepalive: boolean

A boolean to set request's keepalive.

Inherited from

RequestInit.keepalive

Source

node_modules/typescript/lib/lib.dom.d.ts:1601


method?

optional method: string

A string to set request's method.

Inherited from

RequestInit.method

Source

node_modules/typescript/lib/lib.dom.d.ts:1603


mode?

optional mode: RequestMode

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

Source

node_modules/typescript/lib/lib.dom.d.ts:1605


redirect?

optional redirect: RequestRedirect

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

Source

node_modules/typescript/lib/lib.dom.d.ts:1607


referrer?

optional referrer: string

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

Inherited from

RequestInit.referrer

Source

node_modules/typescript/lib/lib.dom.d.ts:1609


referrerPolicy?

optional referrerPolicy: ReferrerPolicy

A referrer policy to set request's referrerPolicy.

Inherited from

RequestInit.referrerPolicy

Source

node_modules/typescript/lib/lib.dom.d.ts:1611


signal?

optional signal: null | AbortSignal

An AbortSignal to set request's signal.

Inherited from

RequestInit.signal

Source

node_modules/typescript/lib/lib.dom.d.ts:1613


uid?

optional uid: string

Source

src/types.ts:38


window?

optional window: null

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

Inherited from

RequestInit.window

Source

node_modules/typescript/lib/lib.dom.d.ts:1615

Type Aliases

fetch-toolkitDocs


fetch-toolkit / HttpMethod

Type alias: HttpMethod

HttpMethod: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"

Source

src/types.ts:1

fetch-toolkitDocs


fetch-toolkit / OnEventCallback

Type alias: OnEventCallback()

OnEventCallback: (event, id, data?, message?) => void

Callback type for the event

Parameters

event: ParallelFunctionEventType

id: string

data?: unknown

message?: string

Returns

void

Source

src/parallel-promise-handler.ts:48

fetch-toolkitDocs


fetch-toolkit / ParallelFunctionEventType

Type alias: ParallelFunctionEventType

ParallelFunctionEventType: "enqueue" | "start" | "finish" | "error"

Type of events that can be triggered

Source

src/parallel-promise-handler.ts:43

Variables

fetch-toolkitDocs


fetch-toolkit / HTTP_HEADER_ACCEPT

Variable: HTTP_HEADER_ACCEPT

const HTTP_HEADER_ACCEPT: "Accept" = "Accept"

The HTTP header for specifying the accepted response format.

Source

src/constants.ts:5

fetch-toolkitDocs


fetch-toolkit / HTTP_HEADER_ACCEPT_JSON

Variable: HTTP_HEADER_ACCEPT_JSON

const HTTP_HEADER_ACCEPT_JSON: "application/json" = "application/json"

The value for specifying that the response should be in JSON format.

Source

src/constants.ts:20

fetch-toolkitDocs


fetch-toolkit / HTTP_HEADER_AUTHORIZATION

Variable: HTTP_HEADER_AUTHORIZATION

const HTTP_HEADER_AUTHORIZATION: "Authorization" = "Authorization"

The HTTP header for specifying the authorization token.

Source

src/constants.ts:10

fetch-toolkitDocs


fetch-toolkit / HTTP_HEADER_CONTENT_TYPE

Variable: HTTP_HEADER_CONTENT_TYPE

const HTTP_HEADER_CONTENT_TYPE: "Content-Type" = "Content-Type"

The HTTP header for specifying the content type of the request.

Source

src/constants.ts:15