HttpParams
class
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): HttpParams set(param: string, value: string): HttpParams delete(param: string, value?: string): HttpParams toString(): string }
Description
This class is immutable - all mutation operations return a new instance.
Constructor
|
options | Type: Optional. Default is |
Methods
has() | ||
---|---|---|
Check whether the body has one or more values for the given parameter name. | ||
|
param | Type: |
Returns
boolean
get() | ||
---|---|---|
Get the first value for the given parameter name, or | ||
|
param | Type: |
Returns
string | null
getAll() | ||
---|---|---|
Get all values for the given parameter name, or | ||
|
param | Type: |
Returns
string[] | null
keys() |
---|
Get all the parameter names for this body. |
|
append() | ||||
---|---|---|---|---|
Construct a new body with an appended value for the given parameter name. | ||||
|
param | Type: |
value | Type: |
Returns
set() | ||||
---|---|---|---|---|
Construct a new body with a new value for the given parameter name. | ||||
|
param | Type: |
value | Type: |
Returns
delete() | ||||
---|---|---|---|---|
Construct a new body with either the given value for the given parameter removed, if a value is given, or all values for the given parameter removed if not. | ||||
|
param | Type: |
value | Type: Optional. Default is |
Returns
toString() |
---|
Serialize the body to an encoded string, where key-value pairs (separated by |
|
© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v6.angular.io/api/common/http/HttpParams