An HTTP request/response body that represents serialized parameters, per the MIME type application/x-www-form-urlencoded.
API
class HttpParams {
constructor(options?: HttpParamsOptions): HttpParams;
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 | undefined): HttpParams;
toString(): string;
}
constructor
HttpParamsHttpParams
has
booleanReports whether the body includes one or more values for a given parameter.
stringThe parameter name.
boolean
get
string | nullRetrieves the first value for a parameter.
stringThe parameter name.
string | null
getAll
string[] | nullRetrieves all values for a parameter.
stringThe parameter name.
string[] | null
keys
string[]Retrieves all the parameters for this body.
string[]
append
HttpParamsAppends a new value to existing values for a parameter.
stringThe parameter name.
string | number | booleanThe new value to add.
HttpParams
appendAll
HttpParamsConstructs a new body with appended values for the given parameter name.
{ [param: string]: string | number | boolean | readonly (string | number | boolean)[]; }parameters and values
HttpParams
set
HttpParamsReplaces the value for a parameter.
stringThe parameter name.
string | number | booleanThe new value.
HttpParams
delete
HttpParamsRemoves a given value or all values from a parameter.
stringThe parameter name.
string | number | boolean | undefinedThe value to remove, if provided.
HttpParams
toString
stringSerializes the body to an encoded string, where key-value pairs (separated by =) are separated by &s.
string
Description
An HTTP request/response body that represents serialized parameters, per the MIME type application/x-www-form-urlencoded.
This class is immutable; all mutation operations return a new instance.