{
  "type": "module",
  "source": "doc/api/api-redirecthandler.md",
  "modules": [
    {
      "textRaw": "Class: RedirectHandler",
      "name": "class:_redirecthandler",
      "type": "module",
      "desc": "<p>A class that handles redirection logic for HTTP requests.</p>",
      "signatures": [
        {
          "textRaw": "`new RedirectHandler(dispatch, maxRedirections, opts, handler)`",
          "name": "RedirectHandler",
          "type": "ctor",
          "params": [
            {
              "name": "dispatch"
            },
            {
              "name": "maxRedirections"
            },
            {
              "name": "opts"
            },
            {
              "name": "handler"
            }
          ],
          "desc": "<p>Arguments:</p>\n<ul>\n<li><strong>dispatch</strong> <code>function</code> - The dispatch function to be called after every retry.</li>\n<li><strong>maxRedirections</strong> <code>number</code> - Maximum number of redirections allowed.</li>\n<li><strong>opts</strong> <code>object</code> - Options for handling redirection. Supports <code>throwOnMaxRedirect</code>, <code>stripHeadersOnRedirect</code>, and <code>stripHeadersOnCrossOriginRedirect</code>.</li>\n<li><strong>handler</strong> <code>object</code> - An object containing handlers for different stages of the request lifecycle.</li>\n</ul>\n<p>Returns: <code>RedirectHandler</code></p>",
          "modules": [
            {
              "textRaw": "Parameters",
              "name": "parameters",
              "type": "module",
              "desc": "<ul>\n<li><strong>dispatch</strong> <code>(options: Dispatch.DispatchOptions, handlers: Dispatch.DispatchHandler) => Promise&#x3C;Dispatch.DispatchResponse></code> (required) - Dispatch function to be called after every redirection.</li>\n<li><strong>maxRedirections</strong> <code>number</code> (required) - Maximum number of redirections allowed.</li>\n<li><strong>opts</strong> <code>object</code> (required) - Options for handling redirection.\n<ul>\n<li><strong>throwOnMaxRedirect</strong> <code>boolean</code> - Throw when the maximum number of redirections is reached.</li>\n<li><strong>stripHeadersOnRedirect</strong> <code>string[]</code> - Header names to remove from all redirected requests.</li>\n<li><strong>stripHeadersOnCrossOriginRedirect</strong> <code>string[]</code> - Header names to remove from cross-origin redirected requests.</li>\n</ul>\n</li>\n<li><strong>handler</strong> <code>object</code> (required) - Handlers for different stages of the request lifecycle.</li>\n</ul>",
              "displayName": "Parameters"
            },
            {
              "textRaw": "Properties",
              "name": "properties",
              "type": "module",
              "desc": "<ul>\n<li><strong>location</strong> <code>string</code> - The current redirection location.</li>\n<li><strong>abort</strong> <code>function</code> - The abort function.</li>\n<li><strong>opts</strong> <code>object</code> - The options for handling redirection.</li>\n<li><strong>maxRedirections</strong> <code>number</code> - Maximum number of redirections allowed.</li>\n<li><strong>handler</strong> <code>object</code> - Handlers for different stages of the request lifecycle.</li>\n<li><strong>history</strong> <code>Array</code> - An array representing the history of URLs during redirection.</li>\n</ul>",
              "displayName": "Properties"
            },
            {
              "textRaw": "Methods",
              "name": "methods",
              "type": "module",
              "methods": [
                {
                  "textRaw": "`onRequestStart(controller, context)`",
                  "name": "onRequestStart",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "controller"
                        },
                        {
                          "name": "context"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called when the request starts.</p>\n<p>Parameters:</p>\n<ul>\n<li><strong>controller</strong> <code>DispatchController</code> - The request controller.</li>\n<li><strong>context</strong> <code>object</code> - The dispatch context.</li>\n</ul>"
                },
                {
                  "textRaw": "`onRequestUpgrade(controller, statusCode, headers, socket)`",
                  "name": "onRequestUpgrade",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "controller"
                        },
                        {
                          "name": "statusCode"
                        },
                        {
                          "name": "headers"
                        },
                        {
                          "name": "socket"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called when an upgrade is requested.</p>\n<p>Parameters:</p>\n<ul>\n<li><strong>controller</strong> <code>DispatchController</code> - The request controller.</li>\n<li><strong>statusCode</strong> <code>number</code> - The HTTP status code.</li>\n<li><strong>headers</strong> <code>object</code> - The headers received in the response.</li>\n<li><strong>socket</strong> <code>object</code> - The socket object.</li>\n</ul>"
                },
                {
                  "textRaw": "`onResponseError(controller, error)`",
                  "name": "onResponseError",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "controller"
                        },
                        {
                          "name": "error"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called when an error occurs.</p>\n<p>Parameters:</p>\n<ul>\n<li><strong>controller</strong> <code>DispatchController</code> - The request controller.</li>\n<li><strong>error</strong> <code>Error</code> - The error that occurred.</li>\n</ul>"
                },
                {
                  "textRaw": "`onResponseStart(controller, statusCode, headers, statusText)`",
                  "name": "onResponseStart",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "controller"
                        },
                        {
                          "name": "statusCode"
                        },
                        {
                          "name": "headers"
                        },
                        {
                          "name": "statusText"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called when headers are received.</p>\n<p>Parameters:</p>\n<ul>\n<li><strong>controller</strong> <code>DispatchController</code> - The request controller.</li>\n<li><strong>statusCode</strong> <code>number</code> - The HTTP status code.</li>\n<li><strong>headers</strong> <code>object</code> - The headers received in the response.</li>\n<li><strong>statusText</strong> <code>string</code> - The status text.</li>\n</ul>"
                },
                {
                  "textRaw": "`onResponseData(controller, chunk)`",
                  "name": "onResponseData",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "controller"
                        },
                        {
                          "name": "chunk"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called when data is received.</p>\n<p>Parameters:</p>\n<ul>\n<li><strong>controller</strong> <code>DispatchController</code> - The request controller.</li>\n<li><strong>chunk</strong> <code>Buffer</code> - The data chunk received.</li>\n</ul>"
                },
                {
                  "textRaw": "`onResponseEnd(controller, trailers)`",
                  "name": "onResponseEnd",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "controller"
                        },
                        {
                          "name": "trailers"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called when the request is complete.</p>\n<p>Parameters:</p>\n<ul>\n<li><strong>controller</strong> <code>DispatchController</code> - The request controller.</li>\n<li><strong>trailers</strong> <code>object</code> - The trailers received.</li>\n</ul>"
                },
                {
                  "textRaw": "`onBodySent(chunk)`",
                  "name": "onBodySent",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "chunk"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called when the request body is sent.</p>\n<p>Parameters:</p>\n<ul>\n<li><strong>chunk</strong> <code>Buffer</code> - The chunk of the request body sent.</li>\n</ul>"
                }
              ],
              "displayName": "Methods"
            }
          ]
        }
      ],
      "displayName": "Class: RedirectHandler"
    }
  ]
}