콘텐츠로 이동

fetch

이 콘텐츠는 아직 번역되지 않았습니다.

Module @netwiv/api/plugins/http · Kind Function

import { fetch } from '@netwiv/api/plugins/http';

Fetch a resource from the network. It returns a Promise that resolves to the Response to that Request, whether it is successful or not.

function fetch(input: string | URL | Request, init?: (RequestInit & ClientOptions) | undefined): Promise<Response>
const response = await fetch("http://my.json.host/data.json");
console.log(response.status); // e.g. 200
console.log(response.statusText); // e.g. "OK"
const jsonData = await response.json();

Upstream since 2.0.0


Descriptions come from the pinned @tauri-apps/plugin-http@2.6.1 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.