Variable options

options: ((options: object, replace?: boolean) => void)

Type declaration

    • (options: object, replace?: boolean): void
    • Sets the default fetch options that will be stored internally when instantiating wretch objects.

      import wretch from "wretch"

      wretch.options({ headers: { "Accept": "application/json" } });

      // The fetch request is sent with both headers.
      wretch("...", { headers: { "X-Custom": "Header" } }).get().res();

      Parameters

      • options: object

        Default options

      • replace: boolean = false

        If true, completely replaces the existing options instead of mixing in

      Returns void

Generated using TypeDoc