> ## Documentation Index
> Fetch the complete documentation index at: https://wreq.sqdsh.win/llms.txt
> Use this file to discover all available pages before exploring further.

# Utilities

> Utility functions for browser profiles and configuration.

## getProfiles()

Get a list of all available browser profile labels.

### Signature

```typescript theme={null}
function getProfiles(): BrowserProfile[]
```

### Returns

Array of profile names that can be used with the `browser` option.

### Example

```typescript theme={null}
import { getProfiles } from 'wreq-js';

const profiles = getProfiles();
console.log(profiles);
// Example output: ['chrome_142', 'firefox_139', 'safari_18', ...]
```

### Using a random profile

```typescript theme={null}
import { fetch, getProfiles } from 'wreq-js';

const profiles = getProfiles();
const randomProfile = profiles[Math.floor(Math.random() * profiles.length)];

const response = await fetch('https://example.com', {
  browser: randomProfile,
});
```

***

## getOperatingSystems()

Get a list of all available operating systems for emulation.

### Signature

```typescript theme={null}
function getOperatingSystems(): EmulationOS[]
```

### Returns

Array of OS names that can be used with the `os` option.

### Example

```typescript theme={null}
import { getOperatingSystems } from 'wreq-js';

const systems = getOperatingSystems();
console.log(systems);
// Example output: ['windows', 'macos', 'linux', 'android', 'ios']
```

### Combining browser and OS

```typescript theme={null}
import { fetch, getProfiles, getOperatingSystems } from 'wreq-js';

// Chrome on Windows
const response = await fetch('https://example.com', {
  browser: 'chrome_142',
  os: 'windows',
});

// Safari on iOS
const mobileResponse = await fetch('https://example.com', {
  browser: 'safari_18',
  os: 'ios',
});
```

***

## Headers

The `Headers` class for working with HTTP headers.

### Constructor

```typescript theme={null}
declare class Headers {
  constructor(init?: HeadersInit);
}
```

### Methods

* `append(name, value)`: add a header value
* `delete(name)`: remove a header
* `get(name)`: get a header value
* `has(name)`: check if header exists
* `set(name, value)`: set a header value
* `entries()`: iterate over header entries
* `keys()`: iterate over header names
* `values()`: iterate over header values

### Example

```typescript theme={null}
import { fetch, Headers } from 'wreq-js';

const headers = new Headers();
headers.set('Authorization', 'Bearer token');
headers.set('Content-Type', 'application/json');

const response = await fetch('https://api.example.com', {
  browser: 'chrome_142',
  headers,
});
```

***

## Response

The `Response` class representing HTTP responses.

### Properties

* `status`: HTTP status code
* `statusText`: HTTP status text
* `headers`: response headers
* `ok`: `true` if status is 200-299
* `url`: final URL after redirects
* `redirected`: `true` if the response is the result of a redirect
* `body`: `ReadableStream<Uint8Array>` or `null`
* `bodyUsed`: `true` if body has been read
* `contentLength`: content length from headers, or `null`
* `cookies`: parsed response cookies as `Record<string, string | string[]>`

### Methods

* `json()`: parse body as JSON
* `text()`: get body as string
* `arrayBuffer()`: get body as ArrayBuffer
* `blob()`: get body as Blob
* `formData()`: parse body as FormData
* `clone()`: clone the response
