Packages

c

io.scalajs.nodejs.url

URLSearchParams

class URLSearchParams extends Object

The URLSearchParams API provides read and write access to the query of a URL. The URLSearchParams class can also be used standalone with one of the four following constructors.

The WHATWG URLSearchParams interface and the querystring module have similar purpose, but the purpose of the querystring module is more general, as it allows the customization of delimiter characters (& and =). On the other hand, this API is designed purely for URL query strings.

Annotations
@JSType() @native() @JSImport("url", "URLSearchParams")
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. URLSearchParams
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new URLSearchParams(it: Iterable[Tuple2[String, String]])

    Instantiate a new URLSearchParams object with an iterable map in a way that is similar to Map's constructor.

    Instantiate a new URLSearchParams object with an iterable map in a way that is similar to Map's constructor. iterable can be an Array or any iterable object. That means iterable can be another URLSearchParams, in which case the constructor will simply create a clone of the provided URLSearchParams. Elements of iterable are key-value pairs, and can themselves be any iterable object.

    it

    An iterable object whose elements are key-value pairs

  2. new URLSearchParams(obj: Object)

    Instantiate a new URLSearchParams object with a query hash map.

    Instantiate a new URLSearchParams object with a query hash map. The key and value of each property of obj are always coerced to strings.

    obj

    An object representing a collection of key-value pairs

  3. new URLSearchParams(obj: Dictionary[_])

    Instantiate a new URLSearchParams object with a query hash map.

    Instantiate a new URLSearchParams object with a query hash map. The key and value of each property of obj are always coerced to strings.

    obj

    An object representing a collection of key-value pairs

  4. new URLSearchParams(queryString: String)

    Parse the string as a query string, and use it to instantiate a new URLSearchParams object.

    Parse the string as a query string, and use it to instantiate a new URLSearchParams object. A leading '?', if present, is ignored.

    queryString

    A query string

  5. new URLSearchParams()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def append(name: String, value: String): Unit

    Append a new name-value pair to the query string.

    Append a new name-value pair to the query string.

    name

    the name of the property

    value

    the value of the property

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. def delete(name: String): Unit

    Remove all name-value pairs whose name is name.

    Remove all name-value pairs whose name is name.

    name

    the name of the property

  8. def entries(): Iterator[Tuple2[String, String]]

    Returns an ES6 Iterator over each of the name-value pairs in the query.

    Returns an ES6 Iterator over each of the name-value pairs in the query. Each item of the iterator is a JavaScript Array. The first item of the Array is the name, the second item of the Array is the value.

    returns

    an iterable of an array of results

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def forEach(fn: Function3[String, String, URLSearchParams, Any]): Unit

    Iterates over each name-value pair in the query and invokes the given function.

    Iterates over each name-value pair in the query and invokes the given function.

    fn

    the function invoked for each name-value pair in the query.

  12. def get(name: String): String

    Returns the value of the first name-value pair whose name is name.

    Returns the value of the first name-value pair whose name is name. If there are no such pairs, null is returned.

    name

    the name of the property

    returns

    the value or null if there is no name-value pair with the given name.

  13. def getAll(name: String): Array[String]

    Returns the values of all name-value pairs whose name is name.

    Returns the values of all name-value pairs whose name is name. If there are no such pairs, an empty array is returned.

    name

    the name of the property

    returns

    the array of values or null if there is no name-value pair with the given name.

  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def has(name: String): Boolean

    Returns true if there is at least one name-value pair whose name is name.

    Returns true if there is at least one name-value pair whose name is name.

    name

    the name of the property

    returns

    true if there is at least one name-value pair whose name is name.

  16. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  20. def keys(): Iterator[String]
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  24. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  25. def set(name: String, value: String): Unit

    Sets the value in the URLSearchParams object associated with name to value.

    Sets the value in the URLSearchParams object associated with name to value. If there are any pre-existing name-value pairs whose names are name, set the first such pair's value to value and remove all others. If not, append the name-value pair to the query string.

    name

    the name of the property

    value

    the value of the property

  26. def sort(): Unit

    Sort all existing name-value pairs in-place by their names.

    Sort all existing name-value pairs in-place by their names. Sorting is done with a stable sorting algorithm, so relative order between name-value pairs with the same name is preserved.

  27. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  28. def toLocaleString(): String
    Definition Classes
    Object
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. def valueOf(): Any
    Definition Classes
    Object
  31. def values(): Iterator[String]

    Returns an ES6 Iterator over the values of each name-value pair.

  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped