global.fetch
Resolves at the response's head; see docs/web-apis.md for what it doesn't do.
Usage
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);Signatures
(input: string | URL, init?: RequestInit): Promise<Response>Parameters
| Name | Type | Required | Description |
|---|---|---|---|
input | string | URL | Yes | — |
init | RequestInit | No | — |
Returns
Promise<Response>
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.