# Constructor

Learn how to initialize a fetch response directly.

The constructor initializes the fetch response with the given content and metadata.

You normally obtain one [when you fetch content](../../core/plug/fetch-content) instead, but you can construct it directly to provide fixed content in tests.

## Signature

The constructor has the following signature:

```php
public function __construct(mixed $content, ?SlotMetadata $metadata = null)
```

## Example

Here is a basic example of how to create a fetch response:

```php
<?php
use Croct\Plug\FetchResponse;

$response = new FetchResponse(['title' => 'Welcome to Croct!']);
```

## Parameters

The following list describes the supported parameters:

- `content`: `mixed`

  The resolved content of the slot.

- `metadata`: `SlotMetadata|null` (optional) (default: null) (see [SlotMetadata](/reference/sdk/php/api/response/slot-metadata))

  The metadata of the resolved content. The default is `null`, which provides no metadata.
