Files
archived-tauri-docs/docs/api/js/classes/http.Client.md
2022-03-29 07:36:52 +02:00

4.1 KiB

@tauri-apps/api / http / Client

Class: Client

http.Client

Properties

id

id: number

Defined in

http.ts:189

Methods

delete

delete<T>(url, options?): Promise<Response<T>>

Makes a DELETE request.

Type parameters

Name
T

Parameters

Name Type Description
url string The request URL.
options? RequestOptions The request options.

Returns

Promise<Response<T>>

A promise resolving to the response.

Defined in

http.ts:333


drop

drop(): Promise<void>

Drops the client instance.

Returns

Promise<void>

Defined in

http.ts:200


get

get<T>(url, options?): Promise<Response<T>>

Makes a GET request.

Type parameters

Name
T

Parameters

Name Type Description
url string The request URL.
options? RequestOptions The request options.

Returns

Promise<Response<T>>

A promise resolving to the response.

Defined in

http.ts:261


patch

patch<T>(url, options?): Promise<Response<T>>

Makes a PATCH request.

Type parameters

Name
T

Parameters

Name Type Description
url string The request URL.
options? RequestOptions The request options.

Returns

Promise<Response<T>>

A promise resolving to the response.

Defined in

http.ts:318


post

post<T>(url, body?, options?): Promise<Response<T>>

Makes a POST request.

Type parameters

Name
T

Parameters

Name Type Description
url string The request URL.
body? Body The body of the request.
options? RequestOptions The request options.

Returns

Promise<Response<T>>

A promise resolving to the response.

Defined in

http.ts:277


put

put<T>(url, body?, options?): Promise<Response<T>>

Makes a PUT request.

Type parameters

Name
T

Parameters

Name Type Description
url string The request URL.
body? Body The body of the request.
options? RequestOptions Request options.

Returns

Promise<Response<T>>

A promise resolving to the response.

Defined in

http.ts:298


request

request<T>(options): Promise<Response<T>>

Makes an HTTP request.

Type parameters

Name
T

Parameters

Name Type Description
options HttpOptions The request options.

Returns

Promise<Response<T>>

A promise resolving to the response.

Defined in

http.ts:216