# fetch

## Response object

<table><thead><tr><th width="150">Property</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>url</td><td>string</td><td>Requested URL</td></tr><tr><td>status</td><td>number | null</td><td>Response status code</td></tr><tr><td>length</td><td>number | null</td><td>Response content length</td></tr><tr><td>ok</td><td>boolean</td><td>Response status (true if code within 200-299, otherwise false)</td></tr></tbody></table>

### response.body(delay)

Request body content

## fetch function

### fetch(url, delay)

```typescript
import { fetch } from '@empathize/framework';

// https://ipinfo.io/developers
fetch('https://ipinfo.io').then((response) => {
    if (response.ok)
    {
        console.log(`OK: ${response.status}`);
        
        response.body().then((body) => {
            console.log(`Your IP: ${JSON.parse(body).ip}`);
        });
    }
    
    else console.log(`Error: ${response.status}`);
});
```
