RequestParams class

Represents a collection of parameters.

Parameters are name-value pairs. But there can be multiple values for the same name. This class provides convenient methods to access the values when the caller expects at-most-one value, as well as methods to access multi-valued parameters. Multi-valued parameters usually occur when processing sets of checkboxes or radio buttons.

The RequestParams is intended to be immutable, since it is normally created by the framework when it receives a HTTP request to process, and passes it to the application's request handlers (which should have no reason to modify them).

There is one situation where an application might want to modify RequestParams, and that is during testing: when the test program wants to build up and modify parameters to simulate different requests. For that purpose, test programs should use instances of the RequestParamsMutable class.

Implementers

Constructors

RequestParams()

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Returns true if there are no keys.
no setter
isNotEmpty bool
Returns true if there is at least one key.
no setter
keys Iterable<String>
All the keys.
no setter
length int
The number of keys.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(String key, String value) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
values(String key, {bool raw = false, ParamsMode mode = ParamsMode.standard}) List<String>
Retrieves the values for a key, possibly multiple values.

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String key) String
Retrieves a single fully sanitized value for the key.