Interface URLSearchParams

    interface URLSearchParams {
        size: number;
        [iterator](): URLSearchParamsIterator<[string, string]>;
        append(name: string, value: string): void;
        delete(name: string, value?: string): void;
        entries(): URLSearchParamsIterator<[string, string]>;
        forEach(callbackfn: ((value: string, key: string, parent: URLSearchParams) => void), thisArg?: any): void;
        get(name: string): string;
        getAll(name: string): string[];
        has(name: string, value?: string): boolean;
        keys(): URLSearchParamsIterator<string>;
        set(name: string, value: string): void;
        sort(): void;
        toString(): string;
        values(): URLSearchParamsIterator<string>;
    }

    Properties

    size: number

    Methods

    • Appends a specified key/value pair as a new search parameter.

      MDN Reference

      Parameters

      • name: string
      • value: string

      Returns void

    • Deletes the given search parameter, and its associated value, from the list of all search parameters.

      MDN Reference

      Parameters

      • name: string
      • Optionalvalue: string

      Returns void

    • Parameters

      • callbackfn: ((value: string, key: string, parent: URLSearchParams) => void)
          • (value, key, parent): void
          • Parameters

            Returns void

      • OptionalthisArg: any

      Returns void

    • Returns the first value associated to the given search parameter.

      MDN Reference

      Parameters

      • name: string

      Returns string

    • Returns all the values association with a given search parameter.

      MDN Reference

      Parameters

      • name: string

      Returns string[]

    • Returns a Boolean indicating if such a search parameter exists.

      MDN Reference

      Parameters

      • name: string
      • Optionalvalue: string

      Returns boolean

    • Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.

      MDN Reference

      Parameters

      • name: string
      • value: string

      Returns void

    • Returns a string containing a query string suitable for use in a URL. Does not include the question mark.

      Returns string