HttpParams
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.
booleanTrue if the parameter has one or more values, false if it has no value or is not present.
get
string | nullRetrieves the first value for a parameter.
stringThe parameter name.
string | nullThe first value of the given parameter, or null if the parameter is not present.
getAll
string[] | nullRetrieves all values for a parameter.
stringThe parameter name.
string[] | nullAll values in a string array, or null if the parameter not present.
keys
string[]Retrieves all the parameters for this body.
string[]The parameter names in a string array.
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.
Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/common/http/HttpParams