-
-
Notifications
You must be signed in to change notification settings - Fork 269
IFetchRequestHeaders
David Ortner edited this page Sep 23, 2025
·
2 revisions
IFetchRequestHeaders represents custom request headers for fetch requests matching specific URLs.
interface IFetchRequestHeadersimport { Browser } from "happy-dom";
const browser = new Browser({
fetch: {
requestHeaders: [
{
url: /^https:\/\/example.com\/[a-z]{2}\/[a-z]{2}\/,
headers: {
'X-Custom-Header': 'CustomValue'
}
}
]
}
});| Property | Type | Description |
|---|---|---|
| url? | string | RegExp | null | URL to match. Matches all if not set. |
| headers | Record<string, string> | Request headers. |
Help Packages