---
url: https://canary.warp-drive.io/api/@warp-drive/holodeck/mock/functions/HEAD.md
description: >-
  Mocks a HEAD request to a url on the Holodeck server, returning a generated
  response with a default 200 status.
---

# &#x20;HEAD()

```ts
function HEAD(
   owner: object, 
   url: string, 
   response: ResponseGenerator, 
   options?: Partial<Omit<Scaffold, "response" | "url" | "method">> & {
  RECORD?: boolean;
}
): Promise<void>;
```

Defined in: [mock.ts:326](https://github.com/warp-drive-data/warp-drive/blob/48dc0d277b98008082669dadc6a52e5c5682ef8e/packages/holodeck/src/mock.ts#L326)

Sets up Mocking for a HEAD request on the mock server
for the supplied url.

The response body is generated by the supplied response function.

Available options:

* status: the status code to return (default: 200)
* headers: the headers to return (default: {})
* body: the body to match against for the request (default: null)
* RECORD: record this request even when the suite is replaying, such as under CI (default: false).
  A local override for re-recording one request. Do not commit it; a committed RECORD means
  that request is never replayed against its fixture.

## Parameters

### owner

`object`

### url

`string`

the url to mock, relative to the mock server host (e.g. `users/1`)

### response

[`ResponseGenerator`](../types/ResponseGenerator.md)

a function which generates the response to return

### options?

[`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)<[`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys)<[`Scaffold`](../types/Scaffold.md), `"response"` | `"url"` | `"method"`>> & {
`RECORD?`: `boolean`;
}

status, headers for the response, body to match against for the request, and whether to force recording

## Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<`void`>
