@servicenow/sdk - v4.9.0
    Preparing search index...

    The Headers interface of the Fetch API allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing headers from the list of the request's headers.

    MDN Reference

    interface Headers {
        "[iterator]"(): HeadersIterator<[string, string]>;
        append(name: string, value: string): void;
        delete(name: string): void;
        entries(): HeadersIterator<[string, string]>;
        forEach(
            callbackfn: (value: string, key: string, parent: Headers) => void,
            thisArg?: any,
        ): void;
        get(name: string): string | null;
        getSetCookie(): string[];
        has(name: string): boolean;
        keys(): HeadersIterator<string>;
        set(name: string, value: string): void;
        values(): HeadersIterator<string>;
    }
    Index

    Methods

    • Returns HeadersIterator<[string, string]>

    • The append() method of the Headers interface appends a new value onto an existing header inside a Headers object, or adds the header if it does not already exist.

      MDN Reference

      Parameters

      • name: string
      • value: string

      Returns void

    • The delete() method of the Headers interface deletes a header from the current Headers object.

      MDN Reference

      Parameters

      • name: string

      Returns void

    • Returns an iterator allowing to go through all key/value pairs contained in this object.

      Returns HeadersIterator<[string, string]>

    • Parameters

      • callbackfn: (value: string, key: string, parent: Headers) => void
      • OptionalthisArg: any

      Returns void

    • The get() method of the Headers interface returns a byte string of all the values of a header within a Headers object with a given name. If the requested header doesn't exist in the Headers object, it returns null.

      MDN Reference

      Parameters

      • name: string

      Returns string | null

    • The getSetCookie() method of the Headers interface returns an array containing the values of all Set-Cookie headers associated with a response. This allows Headers objects to handle having multiple Set-Cookie headers, which wasn't possible prior to its implementation.

      MDN Reference

      Returns string[]

    • The has() method of the Headers interface returns a boolean stating whether a Headers object contains a certain header.

      MDN Reference

      Parameters

      • name: string

      Returns boolean

    • Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.

      Returns HeadersIterator<string>

    • The set() method of the Headers interface sets a new value for an existing header inside a Headers object, or adds the header if it does not already exist.

      MDN Reference

      Parameters

      • name: string
      • value: string

      Returns void

    • Returns an iterator allowing to go through all values of the key/value pairs contained in this object.

      Returns HeadersIterator<string>