global.fetch
Resolves at the response's head; see docs/web-apis.md for what it doesn't do.
Utilização
Measure an operation without relying on wall-clock changes.
// Measure an operation without relying on wall-clock changes.
const start = performance.now();
const response = await fetch('https://example.com/api/health');
console.log(response.status, performance.now() - start);Assinaturas
(input: string | URL, init?: RequestInit): Promise<Response>Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
input | string | URL | Sim | — |
init | RequestInit | Não | — |
Devolve
Promise<Response>
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.