{
  "type": "module",
  "source": "doc/api/api-fetch.md",
  "modules": [
    {
      "textRaw": "Fetch",
      "name": "fetch",
      "introduced_in": "v1.0.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>undici implements the <a href=\"https://fetch.spec.whatwg.org/\">WHATWG Fetch Standard</a>, providing <code>fetch()</code> together\nwith the <code>Request</code>, <code>Response</code>, <code>Headers</code>, and <code>FormData</code> classes that mirror\nthe browser APIs. The implementation follows the standard, so the\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/API/fetch\">MDN Fetch documentation</a> applies as well.</p>\n<pre><code class=\"language-mjs\">import { fetch, Request, Response, Headers, FormData } from 'undici'\n\nconst response = await fetch('https://example.com')\nconst text = await response.text()\n</code></pre>\n<p>When mixing these classes, keep them from the same implementation: use the\nglobal <code>fetch()</code> with the global <code>FormData</code>, <code>Request</code>, <code>Response</code>, and\n<code>Headers</code>, and use undici's <code>fetch()</code> with undici's classes. Passing a value\ncreated by one implementation to the other can throw.</p>",
      "methods": [
        {
          "textRaw": "`fetch(input[, init])`",
          "name": "fetch",
          "type": "method",
          "meta": {
            "added": [
              "v5.6.0"
            ],
            "changes": [
              {
                "version": "v5.6.1",
                "pr-url": "https://github.com/nodejs/undici/pull/1529",
                "description": "No default value is assigned to `init.method`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`input` {string|URL|Request} The resource to fetch. A string or {URL} is treated as the URL to request; a {Request} is used as the request template.",
                  "name": "input",
                  "type": "string|URL|Request",
                  "desc": "The resource to fetch. A string or {URL} is treated as the URL to request; a {Request} is used as the request template."
                },
                {
                  "textRaw": "`init` {RequestInit} (optional) An options object that customizes the request.",
                  "name": "init",
                  "type": "RequestInit",
                  "desc": "(optional) An options object that customizes the request.",
                  "options": [
                    {
                      "textRaw": "`body` {string|Buffer|Uint8Array|Blob|FormData|URLSearchParams|ReadableStream|null} The request body. **Default:** `null`.",
                      "name": "body",
                      "type": "string|Buffer|Uint8Array|Blob|FormData|URLSearchParams|ReadableStream|null",
                      "default": "`null`",
                      "desc": "The request body."
                    },
                    {
                      "textRaw": "`cache` {string} The cache mode. One of `'default'`, `'force-cache'`, `'no-cache'`, `'no-store'`, `'only-if-cached'`, or `'reload'`.",
                      "name": "cache",
                      "type": "string",
                      "desc": "The cache mode. One of `'default'`, `'force-cache'`, `'no-cache'`, `'no-store'`, `'only-if-cached'`, or `'reload'`."
                    },
                    {
                      "textRaw": "`credentials` {string} How credentials are sent. One of `'omit'`, `'include'`, or `'same-origin'`.",
                      "name": "credentials",
                      "type": "string",
                      "desc": "How credentials are sent. One of `'omit'`, `'include'`, or `'same-origin'`."
                    },
                    {
                      "textRaw": "`dispatcher` {Dispatcher} The {Dispatcher} used to perform the request. **Default:** the global dispatcher.",
                      "name": "dispatcher",
                      "type": "Dispatcher",
                      "default": "the global dispatcher",
                      "desc": "The {Dispatcher} used to perform the request."
                    },
                    {
                      "textRaw": "`duplex` {string} The duplex mode of the request. Must be `'half'` when a streaming `body` is provided.",
                      "name": "duplex",
                      "type": "string",
                      "desc": "The duplex mode of the request. Must be `'half'` when a streaming `body` is provided."
                    },
                    {
                      "textRaw": "`headers` {Headers|Object|Array} The request headers, as a {Headers} instance, a plain object, or an array of `[name, value]` pairs.",
                      "name": "headers",
                      "type": "Headers|Object|Array",
                      "desc": "The request headers, as a {Headers} instance, a plain object, or an array of `[name, value]` pairs."
                    },
                    {
                      "textRaw": "`integrity` {string} The subresource integrity metadata of the request.",
                      "name": "integrity",
                      "type": "string",
                      "desc": "The subresource integrity metadata of the request."
                    },
                    {
                      "textRaw": "`keepalive` {boolean} Whether the connection may outlive the page. **Default:** `false`.",
                      "name": "keepalive",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Whether the connection may outlive the page."
                    },
                    {
                      "textRaw": "`method` {string} The request method, for example `'GET'` or `'POST'`.",
                      "name": "method",
                      "type": "string",
                      "desc": "The request method, for example `'GET'` or `'POST'`."
                    },
                    {
                      "textRaw": "`mode` {string} The request mode. One of `'cors'`, `'navigate'`, `'no-cors'`, or `'same-origin'`.",
                      "name": "mode",
                      "type": "string",
                      "desc": "The request mode. One of `'cors'`, `'navigate'`, `'no-cors'`, or `'same-origin'`."
                    },
                    {
                      "textRaw": "`redirect` {string} How redirects are handled. One of `'error'`, `'follow'`, or `'manual'`.",
                      "name": "redirect",
                      "type": "string",
                      "desc": "How redirects are handled. One of `'error'`, `'follow'`, or `'manual'`."
                    },
                    {
                      "textRaw": "`referrer` {string} The request referrer.",
                      "name": "referrer",
                      "type": "string",
                      "desc": "The request referrer."
                    },
                    {
                      "textRaw": "`referrerPolicy` {string} The referrer policy. One of `''`, `'no-referrer'`, `'no-referrer-when-downgrade'`, `'origin'`, `'origin-when-cross-origin'`, `'same-origin'`, `'strict-origin'`, `'strict-origin-when-cross-origin'`, or `'unsafe-url'`.",
                      "name": "referrerPolicy",
                      "type": "string",
                      "desc": "The referrer policy. One of `''`, `'no-referrer'`, `'no-referrer-when-downgrade'`, `'origin'`, `'origin-when-cross-origin'`, `'same-origin'`, `'strict-origin'`, `'strict-origin-when-cross-origin'`, or `'unsafe-url'`."
                    },
                    {
                      "textRaw": "`signal` {AbortSignal|null} An {AbortSignal} used to abort the request. **Default:** `null`.",
                      "name": "signal",
                      "type": "AbortSignal|null",
                      "default": "`null`",
                      "desc": "An {AbortSignal} used to abort the request."
                    },
                    {
                      "textRaw": "`window` {null} Can only be `null`; reserved by the standard.",
                      "name": "window",
                      "type": "null",
                      "desc": "Can only be `null`; reserved by the standard."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise} Fulfills with a {Response} once the response headers have been received.",
                "name": "return",
                "type": "Promise",
                "desc": "Fulfills with a {Response} once the response headers have been received."
              }
            }
          ],
          "desc": "<p>Starts the process of fetching a resource from the network and returns a\npromise that fulfills with a <a href=\"https://developer.mozilla.org/docs/Web/API/Response\"><code>&#x3C;Response></code></a>. The promise rejects only on network\nfailures; an HTTP error status such as <code>404</code> still fulfills the promise, so\ninspect <a href=\"#responseok\"><code>response.ok</code></a> to detect failures.</p>\n<pre><code class=\"language-mjs\">import { fetch } from 'undici'\n\nconst response = await fetch('https://example.com', {\n  method: 'POST',\n  headers: { 'content-type': 'application/json' },\n  body: JSON.stringify({ hello: 'world' }),\n})\n\nconsole.log(response.status)\nconsole.log(await response.json())\n</code></pre>\n<p>To route the request through a custom <a href=\"Dispatcher.md#class-dispatcher\"><code>&#x3C;Dispatcher></code></a> (for example a <code>ProxyAgent</code>\nor <code>Agent</code> with specific options), pass it as <code>init.dispatcher</code>.</p>\n<pre><code class=\"language-mjs\">import { fetch, Agent } from 'undici'\n\nconst response = await fetch('https://example.com', {\n  dispatcher: new Agent({ connect: { rejectUnauthorized: false } }),\n})\n</code></pre>"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `FormData`",
          "name": "FormData",
          "type": "class",
          "meta": {
            "added": [
              "v4.4.4"
            ],
            "changes": []
          },
          "desc": "<p>A set of key/value pairs representing form fields and their values, suitable\nfor use as a <code>fetch()</code> request <code>body</code>. The implementation follows the\n<a href=\"https://fetch.spec.whatwg.org/\">WHATWG Fetch Standard</a>; see the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/FormData\">MDN <code>FormData</code> documentation</a>.</p>\n<p>When using <code>FormData</code> as a request body, keep <code>fetch</code> and <code>FormData</code> from the\nsame implementation: use the global <code>FormData</code> with the global <code>fetch()</code>, and\nundici's <code>FormData</code> with undici's <code>fetch()</code>.</p>",
          "signatures": [
            {
              "textRaw": "`new FormData()`",
              "name": "FormData",
              "type": "ctor",
              "meta": {
                "added": [
                  "v4.4.4"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Creates a new, empty <code>FormData</code> instance. Passing any argument other than\n<code>undefined</code> throws; in particular, an <code>HTMLFormElement</code> argument is not\nsupported in this environment.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`formData.append(name, value[, filename])`",
              "name": "append",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the field.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the field."
                    },
                    {
                      "textRaw": "`value` {string|Blob} The value of the field.",
                      "name": "value",
                      "type": "string|Blob",
                      "desc": "The value of the field."
                    },
                    {
                      "textRaw": "`filename` {string} The filename reported to the server when `value` is a {Blob}. (optional)",
                      "name": "filename",
                      "type": "string",
                      "desc": "The filename reported to the server when `value` is a {Blob}. (optional)",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Appends a new value to an existing key, or adds the key if it does not exist.\nUnlike <a href=\"#formdatasetname-value-filename\"><code>formData.set()</code></a>, <code>append()</code> keeps\nany existing values for <code>name</code>.</p>"
            },
            {
              "textRaw": "`formData.delete(name)`",
              "name": "delete",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the field to remove.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the field to remove."
                    }
                  ]
                }
              ],
              "desc": "<p>Deletes all values associated with <code>name</code>.</p>"
            },
            {
              "textRaw": "`formData.get(name)`",
              "name": "get",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the field to read.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the field to read."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|File|null} The first value associated with `name`, or `null` if there is none.",
                    "name": "return",
                    "type": "string|File|null",
                    "desc": "The first value associated with `name`, or `null` if there is none."
                  }
                }
              ]
            },
            {
              "textRaw": "`formData.getAll(name)`",
              "name": "getAll",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the field to read.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the field to read."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Array} All values associated with `name`, as an array of {string} and {File} entries.",
                    "name": "return",
                    "type": "Array",
                    "desc": "All values associated with `name`, as an array of {string} and {File} entries."
                  }
                }
              ]
            },
            {
              "textRaw": "`formData.has(name)`",
              "name": "has",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the field to look up.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the field to look up."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` if at least one value is associated with `name`.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` if at least one value is associated with `name`."
                  }
                }
              ]
            },
            {
              "textRaw": "`formData.set(name, value[, filename])`",
              "name": "set",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the field.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the field."
                    },
                    {
                      "textRaw": "`value` {string|Blob} The value of the field.",
                      "name": "value",
                      "type": "string|Blob",
                      "desc": "The value of the field."
                    },
                    {
                      "textRaw": "`filename` {string} The filename reported to the server when `value` is a {Blob}. (optional)",
                      "name": "filename",
                      "type": "string",
                      "desc": "The filename reported to the server when `value` is a {Blob}. (optional)",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sets a new value for an existing key, or adds the key if it does not exist,\nreplacing any values previously associated with <code>name</code>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Response`",
          "name": "Response",
          "type": "class",
          "meta": {
            "added": [
              "v4.4.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"Fetch.md#new-formdata\"><code>&#x3C;BodyMixin></code></a></li>\n</ul>\n<p>Represents the response to a request. Instances are typically obtained by\nawaiting <code>fetch()</code>, but can also be constructed directly. The implementation\nfollows the <a href=\"https://fetch.spec.whatwg.org/\">WHATWG Fetch Standard</a>; see the\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Response\">MDN <code>Response</code> documentation</a>. <code>Response</code> inherits the body-reading methods\ndescribed in <a href=\"#body-mixin\">Body mixin</a>.</p>",
          "signatures": [
            {
              "textRaw": "`new Response([body[, init]])`",
              "name": "Response",
              "type": "ctor",
              "meta": {
                "added": [
                  "v4.4.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`body` {string|Buffer|Uint8Array|Blob|FormData|URLSearchParams|ReadableStream|null} The response body. **Default:** `null`.",
                  "name": "body",
                  "type": "string|Buffer|Uint8Array|Blob|FormData|URLSearchParams|ReadableStream|null",
                  "default": "`null`",
                  "desc": "The response body.",
                  "optional": true
                },
                {
                  "textRaw": "`init` {ResponseInit} (optional)",
                  "name": "init",
                  "type": "ResponseInit",
                  "desc": "(optional)",
                  "options": [
                    {
                      "textRaw": "`status` {number} The response status code. **Default:** `200`.",
                      "name": "status",
                      "type": "number",
                      "default": "`200`",
                      "desc": "The response status code."
                    },
                    {
                      "textRaw": "`statusText` {string} The response status message. **Default:** `''`.",
                      "name": "statusText",
                      "type": "string",
                      "default": "`''`",
                      "desc": "The response status message."
                    },
                    {
                      "textRaw": "`headers` {Headers|Object|Array} The response headers.",
                      "name": "headers",
                      "type": "Headers|Object|Array",
                      "desc": "The response headers."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Creates a new <code>Response</code>.</p>"
            }
          ],
          "classMethods": [
            {
              "textRaw": "Static method: `Response.error()`",
              "name": "error",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Response} A network-error response.",
                    "name": "return",
                    "type": "Response",
                    "desc": "A network-error response."
                  }
                }
              ],
              "desc": "<p>Returns a new <code>Response</code> representing a network error, with its\n<a href=\"#responsetype\"><code>type</code></a> set to <code>'error'</code>.</p>"
            },
            {
              "textRaw": "Static method: `Response.json(data[, init])`",
              "name": "json",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any} The value to serialize as JSON.",
                      "name": "data",
                      "type": "any",
                      "desc": "The value to serialize as JSON."
                    },
                    {
                      "textRaw": "`init` {ResponseInit} (optional)",
                      "name": "init",
                      "type": "ResponseInit",
                      "desc": "(optional)",
                      "options": [
                        {
                          "textRaw": "`status` {number} The response status code. **Default:** `200`.",
                          "name": "status",
                          "type": "number",
                          "default": "`200`",
                          "desc": "The response status code."
                        },
                        {
                          "textRaw": "`statusText` {string} The response status message. **Default:** `''`.",
                          "name": "statusText",
                          "type": "string",
                          "default": "`''`",
                          "desc": "The response status message."
                        },
                        {
                          "textRaw": "`headers` {Headers|Object|Array} The response headers.",
                          "name": "headers",
                          "type": "Headers|Object|Array",
                          "desc": "The response headers."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Response} A response whose body is the JSON serialization of `data` and whose `Content-Type` is `application/json`.",
                    "name": "return",
                    "type": "Response",
                    "desc": "A response whose body is the JSON serialization of `data` and whose `Content-Type` is `application/json`."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">import { Response } from 'undici'\n\nconst response = Response.json({ ok: true }, { status: 201 })\n</code></pre>"
            },
            {
              "textRaw": "Static method: `Response.redirect(url[, status])`",
              "name": "redirect",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`url` {string|URL} The URL to redirect to.",
                      "name": "url",
                      "type": "string|URL",
                      "desc": "The URL to redirect to."
                    },
                    {
                      "textRaw": "`status` {number} The redirect status code. One of `301`, `302`, `303`, `307`, or `308`. **Default:** `302`.",
                      "name": "status",
                      "type": "number",
                      "default": "`302`",
                      "desc": "The redirect status code. One of `301`, `302`, `303`, `307`, or `308`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Response} A redirect response with the `Location` header set to `url`.",
                    "name": "return",
                    "type": "Response",
                    "desc": "A redirect response with the `Location` header set to `url`."
                  }
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`response.clone()`",
              "name": "clone",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Response} A copy of the response.",
                    "name": "return",
                    "type": "Response",
                    "desc": "A copy of the response."
                  }
                }
              ],
              "desc": "<p>Creates a clone of the response. Throws a <code>TypeError</code> if the body has already\nbeen read or is locked.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string} The response type. One of `'basic'`, `'cors'`, `'default'`, `'error'`, `'opaque'`, or `'opaqueredirect'`.",
              "name": "type",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The response type. One of `'basic'`, `'cors'`, `'default'`, `'error'`, `'opaque'`, or `'opaqueredirect'`."
            },
            {
              "textRaw": "Type: {string} The final URL of the response after any redirects, or the empty string if not available.",
              "name": "url",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The final URL of the response after any redirects, or the empty string if not available."
            },
            {
              "textRaw": "Type: {boolean} `true` if the response is the result of one or more redirects.",
              "name": "redirected",
              "type": "boolean",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "`true` if the response is the result of one or more redirects."
            },
            {
              "textRaw": "Type: {number} The HTTP status code of the response.",
              "name": "status",
              "type": "number",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The HTTP status code of the response."
            },
            {
              "textRaw": "Type: {boolean} `true` when `status` is in the range `200`–`299`.",
              "name": "ok",
              "type": "boolean",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "`true` when `status` is in the range `200`–`299`."
            },
            {
              "textRaw": "Type: {string} The status message corresponding to the status code.",
              "name": "statusText",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The status message corresponding to the status code."
            },
            {
              "textRaw": "Type: {Headers} The {Headers} object associated with the response.",
              "name": "headers",
              "type": "Headers",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The {Headers} object associated with the response."
            }
          ]
        },
        {
          "textRaw": "Class: `Request`",
          "name": "Request",
          "type": "class",
          "meta": {
            "added": [
              "v1.0.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"Fetch.md#new-formdata\"><code>&#x3C;BodyMixin></code></a></li>\n</ul>\n<p>Represents a resource request. Instances can be passed to <code>fetch()</code> in place\nof a URL string. The implementation follows the <a href=\"https://fetch.spec.whatwg.org/\">WHATWG Fetch Standard</a>; see\nthe <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Request\">MDN <code>Request</code> documentation</a>. <code>Request</code> inherits the body-reading\nmethods described in <a href=\"#body-mixin\">Body mixin</a>.</p>",
          "signatures": [
            {
              "textRaw": "`new Request(input[, init])`",
              "name": "Request",
              "type": "ctor",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`input` {string|URL|Request} The resource to request, as a URL string, {URL}, or another {Request} to copy.",
                  "name": "input",
                  "type": "string|URL|Request",
                  "desc": "The resource to request, as a URL string, {URL}, or another {Request} to copy."
                },
                {
                  "textRaw": "`init` {RequestInit} (optional) An options object with the same fields as the `init` argument of `fetch()`.",
                  "name": "init",
                  "type": "RequestInit",
                  "desc": "(optional) An options object with the same fields as the `init` argument of `fetch()`.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Request}",
                "name": "return",
                "type": "Request"
              },
              "desc": "<p>Creates a new <code>Request</code>.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`request.clone()`",
              "name": "clone",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Request} A copy of the request.",
                    "name": "return",
                    "type": "Request",
                    "desc": "A copy of the request."
                  }
                }
              ],
              "desc": "<p>Creates a clone of the request. Throws a <code>TypeError</code> if the body has already\nbeen read or is locked.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string} The request method, for example `'GET'`.",
              "name": "method",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The request method, for example `'GET'`."
            },
            {
              "textRaw": "Type: {string} The serialized URL of the request.",
              "name": "url",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The serialized URL of the request."
            },
            {
              "textRaw": "Type: {Headers} The {Headers} object associated with the request.",
              "name": "headers",
              "type": "Headers",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The {Headers} object associated with the request."
            },
            {
              "textRaw": "Type: {string} The request destination, indicating the type of content being requested, for example `''`, `'image'`, or `'script'`.",
              "name": "destination",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The request destination, indicating the type of content being requested, for example `''`, `'image'`, or `'script'`."
            },
            {
              "textRaw": "Type: {string} The referrer of the request. May be `'about:client'` or a URL string.",
              "name": "referrer",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The referrer of the request. May be `'about:client'` or a URL string."
            },
            {
              "textRaw": "Type: {string} The referrer policy of the request.",
              "name": "referrerPolicy",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The referrer policy of the request."
            },
            {
              "textRaw": "Type: {string} The mode of the request. One of `'cors'`, `'navigate'`, `'no-cors'`, or `'same-origin'`.",
              "name": "mode",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The mode of the request. One of `'cors'`, `'navigate'`, `'no-cors'`, or `'same-origin'`."
            },
            {
              "textRaw": "Type: {string} The credentials mode of the request. One of `'omit'`, `'include'`, or `'same-origin'`.",
              "name": "credentials",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The credentials mode of the request. One of `'omit'`, `'include'`, or `'same-origin'`."
            },
            {
              "textRaw": "Type: {string} The cache mode of the request.",
              "name": "cache",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The cache mode of the request."
            },
            {
              "textRaw": "Type: {string} The redirect mode of the request. One of `'error'`, `'follow'`, or `'manual'`.",
              "name": "redirect",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The redirect mode of the request. One of `'error'`, `'follow'`, or `'manual'`."
            },
            {
              "textRaw": "Type: {string} The subresource integrity metadata of the request.",
              "name": "integrity",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The subresource integrity metadata of the request."
            },
            {
              "textRaw": "Type: {boolean} Whether the request may outlive the environment that created it.",
              "name": "keepalive",
              "type": "boolean",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "Whether the request may outlive the environment that created it."
            },
            {
              "textRaw": "Type: {boolean} `true` if the request is a reload navigation.",
              "name": "isReloadNavigation",
              "type": "boolean",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "`true` if the request is a reload navigation."
            },
            {
              "textRaw": "Type: {boolean} `true` if the request is a history navigation.",
              "name": "isHistoryNavigation",
              "type": "boolean",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "`true` if the request is a history navigation."
            },
            {
              "textRaw": "Type: {AbortSignal} The {AbortSignal} associated with the request.",
              "name": "signal",
              "type": "AbortSignal",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The {AbortSignal} associated with the request."
            },
            {
              "textRaw": "Type: {string} The duplex mode of the request. Always `'half'`.",
              "name": "duplex",
              "type": "string",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The duplex mode of the request. Always `'half'`."
            }
          ]
        },
        {
          "textRaw": "Class: `Headers`",
          "name": "Headers",
          "type": "class",
          "meta": {
            "added": [
              "v4.4.0"
            ],
            "changes": []
          },
          "desc": "<p>Represents the header list of a request or response and provides methods to\nread and modify it. The implementation follows the <a href=\"https://fetch.spec.whatwg.org/\">WHATWG Fetch Standard</a>;\nsee the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Headers\">MDN <code>Headers</code> documentation</a>. <code>Headers</code> is iterable, yielding\n<code>[name, value]</code> pairs sorted by name.</p>",
          "signatures": [
            {
              "textRaw": "`new Headers([init])`",
              "name": "Headers",
              "type": "ctor",
              "meta": {
                "added": [
                  "v4.4.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`init` {Headers|Object|Array} (optional) Initial headers, as a {Headers} instance, a plain object of name/value pairs, or an array of `[name, value]` pairs.",
                  "name": "init",
                  "type": "Headers|Object|Array",
                  "desc": "(optional) Initial headers, as a {Headers} instance, a plain object of name/value pairs, or an array of `[name, value]` pairs.",
                  "optional": true
                }
              ],
              "desc": "<p>Creates a new <code>Headers</code> object.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`headers.append(name, value)`",
              "name": "append",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the header.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the header."
                    },
                    {
                      "textRaw": "`value` {string} The value of the header.",
                      "name": "value",
                      "type": "string",
                      "desc": "The value of the header."
                    }
                  ]
                }
              ],
              "desc": "<p>Appends a value to a header, or adds the header if it does not exist. Existing\nvalues for <code>name</code> are preserved.</p>"
            },
            {
              "textRaw": "`headers.delete(name)`",
              "name": "delete",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the header to remove.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the header to remove."
                    }
                  ]
                }
              ],
              "desc": "<p>Removes the header named <code>name</code>.</p>"
            },
            {
              "textRaw": "`headers.get(name)`",
              "name": "get",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the header to read.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the header to read."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|null} The combined values of the header, or `null` if it is not present.",
                    "name": "return",
                    "type": "string|null",
                    "desc": "The combined values of the header, or `null` if it is not present."
                  }
                }
              ]
            },
            {
              "textRaw": "`headers.has(name)`",
              "name": "has",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the header to look up.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the header to look up."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` if the header is present.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` if the header is present."
                  }
                }
              ]
            },
            {
              "textRaw": "`headers.set(name, value)`",
              "name": "set",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the header.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the header."
                    },
                    {
                      "textRaw": "`value` {string} The value of the header.",
                      "name": "value",
                      "type": "string",
                      "desc": "The value of the header."
                    }
                  ]
                }
              ],
              "desc": "<p>Sets a header to a single value, replacing any existing values for <code>name</code>.</p>"
            },
            {
              "textRaw": "`headers.getSetCookie()`",
              "name": "getSetCookie",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string}[] An array of the values of all `Set-Cookie` headers.",
                    "name": "return",
                    "type": "string",
                    "desc": "[] An array of the values of all `Set-Cookie` headers."
                  }
                }
              ],
              "desc": "<p>Returns each <code>Set-Cookie</code> header as a separate string, without combining them.</p>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Body mixin",
          "name": "body_mixin",
          "type": "module",
          "desc": "<p><code>Request</code> and <code>Response</code> both extend <a href=\"Fetch.md#new-formdata\"><code>&#x3C;BodyMixin></code></a>, which provides methods and\nproperties for reading a body. Each consuming method reads the body once; after\nthe body has been consumed, <a href=\"#bodybodyused\"><code>bodyUsed</code></a> becomes <code>true</code> and\ncalling another consuming method throws a <code>TypeError</code>.</p>",
          "methods": [
            {
              "textRaw": "`body.arrayBuffer()`",
              "name": "arrayBuffer",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an {ArrayBuffer} containing the body bytes.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an {ArrayBuffer} containing the body bytes."
                  }
                }
              ]
            },
            {
              "textRaw": "`body.blob()`",
              "name": "blob",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a {Blob} containing the body.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a {Blob} containing the body."
                  }
                }
              ]
            },
            {
              "textRaw": "`body.bytes()`",
              "name": "bytes",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a {Uint8Array} containing the body bytes.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a {Uint8Array} containing the body bytes."
                  }
                }
              ]
            },
            {
              "textRaw": "`body.formData()`",
              "name": "formData",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a {FormData} parsed from the body.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a {FormData} parsed from the body."
                  }
                }
              ],
              "desc": "<p>Buffers and parses the entire body as <code>multipart/form-data</code> or\n<code>application/x-www-form-urlencoded</code>. Because multipart parsing has inherent\nsecurity risks and the whole body is buffered, this method must only be called\non responses from trusted servers.</p>\n<p>For responses from untrusted or user-controlled servers, use a dedicated\nstreaming parser such as <a href=\"https://www.npmjs.com/package/@fastify/busboy\">@fastify/busboy</a> and apply application-specific\nlimits:</p>\n<pre><code class=\"language-mjs\">import { Busboy } from '@fastify/busboy'\nimport { Readable } from 'node:stream'\n\nconst response = await fetch('...')\nconst busboy = new Busboy({\n  headers: { 'content-type': response.headers.get('content-type') },\n})\n\n// Handle the events emitted by `busboy`.\n\nReadable.fromWeb(response.body).pipe(busboy)\n</code></pre>"
            },
            {
              "textRaw": "`body.json()`",
              "name": "json",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the result of parsing the body as JSON.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the result of parsing the body as JSON."
                  }
                }
              ]
            },
            {
              "textRaw": "`body.text()`",
              "name": "text",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a {string} containing the body decoded as UTF-8.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a {string} containing the body decoded as UTF-8."
                  }
                }
              ]
            },
            {
              "textRaw": "`body.textStream()`",
              "name": "textStream",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {ReadableStream} A {ReadableStream} of {string} chunks produced by decoding the body as UTF-8.",
                    "name": "return",
                    "type": "ReadableStream",
                    "desc": "A {ReadableStream} of {string} chunks produced by decoding the body as UTF-8."
                  }
                }
              ],
              "desc": "<p>An undici-specific extension that exposes the body as a stream of decoded text\nchunks rather than buffering it. It is not part of the <a href=\"https://fetch.spec.whatwg.org/\">WHATWG Fetch\nStandard</a>.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {ReadableStream|null} The body as a {ReadableStream}, or `null` if the message has no body.",
              "name": "body",
              "type": "ReadableStream|null",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "The body as a {ReadableStream}, or `null` if the message has no body."
            },
            {
              "textRaw": "Type: {boolean} `true` once the body has been read.",
              "name": "bodyUsed",
              "type": "boolean",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "desc": "`true` once the body has been read."
            }
          ],
          "displayName": "Body mixin"
        }
      ]
    }
  ]
}