• Overview
@angular/common/http

HttpParams

Class

An HTTP request/response body that represents serialized parameters, per the MIME type application/x-www-form-urlencoded.

  
    class HttpParams {}
  
  

has

boolean

Reports whether the body includes one or more values for a given parameter.

@paramparamstring

The parameter name.

@returnsboolean

get

string | null

Retrieves the first value for a parameter.

@paramparamstring

The parameter name.

@returnsstring | null

getAll

string[] | null

Retrieves all values for a parameter.

@paramparamstring

The parameter name.

@returnsstring[] | null

keys

string[]

Retrieves all the parameters for this body.

@returnsstring[]

Appends a new value to existing values for a parameter.

@paramparamstring

The parameter name.

@paramvaluestring | number | boolean

The new value to add.

@returnsHttpParams

appendAll

Constructs a new body with appended values for the given parameter name.

@paramparams{ [param: string]: string | number | boolean | readonly (string | number | boolean)[]; }

parameters and values

@returnsHttpParams

Replaces the value for a parameter.

@paramparamstring

The parameter name.

@paramvaluestring | number | boolean

The new value.

@returnsHttpParams

Removes a given value or all values from a parameter.

@paramparamstring

The parameter name.

@paramvaluestring | number | boolean | undefined

The value to remove, if provided.

@returnsHttpParams

toString

string

Serializes the body to an encoded string, where key-value pairs (separated by =) are separated by &s.

@returnsstring
Jump to details