HttpParams
An HTTP request/response body that represents serialized parameters,
per the MIME type application/x-www-form-urlencoded
.
class HttpParams {
constructor(options: HttpParamsOptions = {} as HttpParamsOptions)
has(param: string): boolean
get(param: string): string | null
getAll(param: string): string[] | null
keys(): string[]
append(param: string, value: string | number | boolean): HttpParams
appendAll(params: { [param: string]: string | number | boolean | readonly (string | number | boolean)[]; }): HttpParams
set(param: string, value: string | number | boolean): HttpParams
delete(param: string, value?: string | number | boolean): HttpParams
toString(): string
}
Description
This class is immutable; all mutation operations return a new instance.
Constructor
Parameters
|
Methods
has() |
---|
Reports whether the body includes one or more values for a given parameter. |
get() |
---|
Retrieves the first value for a parameter. |
getAll() |
---|
Retrieves all values for a parameter. |
keys() |
---|
Retrieves all the parameters for this body. |
ParametersThere are no parameters. Returns
|
append() | ||||||
---|---|---|---|---|---|---|
Appends a new value to existing values for a parameter. |
||||||
Parameters
Returns
|
appendAll() | |||
---|---|---|---|
Constructs a new body with appended values for the given parameter name. |
|||
Parameters
Returns
|
set() | ||||||
---|---|---|---|---|---|---|
Replaces the value for a parameter. |
||||||
Parameters
Returns
|
delete() | ||||||
---|---|---|---|---|---|---|
Removes a given value or all values from a parameter. |
||||||
Parameters
Returns
|
toString() |
---|
Serializes the body to an encoded string, where key-value pairs (separated by |
ParametersThere are no parameters. Returns
|