Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Options

Options are the same as window.fetch, except for the KyOptions

interface Options extends KyOptions, Omit<RequestInit, "headers"> {
headers?: KyHeadersInit;
method?: LiteralUnion<HttpMethod, string>;
}

§Extends

§
KyOptions
[src]
§
Omit<RequestInit, "headers">
[src]

§Properties

§
headers?: KyHeadersInit
[src]

HTTP headers used to make the request.

You can pass a `Headers` instance or a plain object.

You can remove a header with `.extend()` by passing the header with an `undefined` value.
@example
    import ky from 'ky';

    const url = 'https://sindresorhus.com';

    const original = ky.create({
        headers: {
            rainbow: 'rainbow',
            unicorn: 'unicorn'
        }
    });

    const extended = original.extend({
        headers: {
            rainbow: undefined
        }
    });

    const response = await extended(url).json();

    console.log('rainbow' in response);
    //=> false

    console.log('unicorn' in response);
    //=> true
    ```
§
method?: LiteralUnion<HttpMethod, string>
[src]

HTTP method used to make the request.

Internally, the standard methods (`GET`, `POST`, `PUT`, `PATCH`, `HEAD` and `DELETE`) are uppercased in order to avoid server errors due to case sensitivity.