Options
All
  • Public
  • Public/Protected
  • All
Menu

The URLSearchParams interface defines utility methods to work with the query string of a URL.

Hierarchy

  • URLSearchParams

Index

Constructors

constructor

Methods

append

  • append(name: string, value: string): void
  • Appends a specified key/value pair as a new search parameter.

    Parameters

    • name: string
    • value: string

    Returns void

delete

  • delete(name: string): void
  • Deletes the given search parameter, and its associated value, from the list of all search parameters.

    Parameters

    • name: string

    Returns void

forEach

  • forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void
  • Allows iteration through all values contained in this object via a callback function.

    Parameters

    Returns void

get

  • get(name: string): null | string
  • Returns the first value associated to the given search parameter.

    Parameters

    • name: string

    Returns null | string

getAll

  • getAll(name: string): string[]
  • Returns all the values association with a given search parameter.

    Parameters

    • name: string

    Returns string[]

has

  • has(name: string): boolean
  • Returns a Boolean indicating if such a search parameter exists.

    Parameters

    • name: string

    Returns boolean

set

  • set(name: string, value: string): void
  • Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.

    Parameters

    • name: string
    • value: string

    Returns void

sort

  • sort(): void
  • Sorts all key/value pairs, if any, by their keys.

    Returns void

toString

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

    Returns string

Generated using TypeDoc