Tauri fetch
fetch<>(: , :FetchOptions):Promise<ResponseTurlstringoptions?<T>>
使用默认客户端执行 HTTP 请求。
例
import { fetch } from '@tauri-apps/api/http';
const response = await fetch('http://localhost:3003/users/2', {
method: 'GET',
timeout: 30,
});类型参数
- T
参数
| 名字 | 类型 |
|---|---|
url | string |
options? | FetchOptions |
Returns: Promise<Response<T>>