up.Params
JavaScript class
The up.Params class offers a consistent API to read and manipulate request parameters
independent of their type.
Request parameters are used in form submissions and
URLs. Methods like up.submit() or up.render() accept
request parameters as a { params } option.
Supported parameter types
The following types of parameter representation are supported:
- An object like
{ email: 'foo@bar.com' } - A query string like
'email=foo%40bar.com' - An array of
{ name, value }objects like[{ name: 'email', value: 'foo@bar.com' }] - A FormData object.
Features
-
Constructs a new
up.Paramsinstance. -
Adds a new entry with the given
nameandvalue. -
Adds all entries from the given list of params.
-
Adds params from the given HTML form field.
-
Removes all params from this object.
-
Deletes all entries with the given
name. -
Returns the first param value with the given
name. -
Returns an array of all param values with the given
name. -
Returns the first param value with the given
name. -
Sets the
valuefor the entry with givenname. -
Returns an array representation of this
up.Paramsinstance. -
Returns a
FormDatarepresentation of thisup.Paramsinstance. -
Returns an object representation of this
up.Paramsinstance. -
Returns a query string for this
up.Paramsinstance. -
Builds a URL string from the given base URL and this
up.Paramsinstance as a query string. -
Constructs a new
up.Paramsinstance from the fields within the given container. -
Constructs a new
up.Paramsinstance from one or more HTML form fields. -
Constructs a new
up.Paramsinstance from the given<form>. -
Constructs a new
up.Paramsinstance from the given URL's query string. -
Returns the given URL without its query string.