Skip to main content

Access the HTTP client written in Rust.

Table of contents#

Enumerations#

Classes#

Interfaces#

Type aliases#

FetchOptions#

Ƭ FetchOptions: Omit<HttpOptions, url>

Options for the fetch API.

Defined in: http.ts:107


HttpVerb#

Ƭ HttpVerb: GET | POST | PUT | DELETE | PATCH | HEAD | OPTIONS | CONNECT | TRACE

The request HTTP verb.

Defined in: http.ts:82


Part#

Ƭ Part: string | number[]

Defined in: http.ts:23


RequestOptions#

Ƭ RequestOptions: Omit<HttpOptions, method | url>

Request options.

Defined in: http.ts:105

Functions#

fetch#

fetch<T>(url: string, options?: FetchOptions): Promise<Response<T>>

Perform an HTTP request using the default client.

Type parameters:#

Name
T

Parameters:#

NameTypeDescription
urlstringThe request URL.
options?FetchOptionsThe fetch options.

Returns: Promise<Response<T>>

The response object.

Defined in: http.ts:275


getClient#

getClient(options?: ClientOptions): Promise<Client>

Creates a new client using the specified options.

Parameters:#

NameTypeDescription
options?ClientOptionsClient configuration.

Returns: Promise<Client>

A promise resolving to the client instance.

Defined in: http.ts:255