4.1 KiB
@tauri-apps/api / http / Client
Class: Client
http.Client
Properties
id
• id: number
Defined in
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
drop
▸ drop(): Promise<void>
Drops the client instance.
Returns
Promise<void>
Defined in
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
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
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
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
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.