HttpParams • Angular 日本語版

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;}
    
    

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

@paramparamstring

The parameter name.

@returnsboolean

Retrieves the first value for a parameter.

@paramparamstring

The parameter name.

@returnsstring | null

Retrieves all values for a parameter.

@paramparamstring

The parameter name.

@returnsstring[] | null

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.

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

Replaces the value for a parameter.

@paramparamstring

The parameter name.

@paramvaluestring | number | boolean

The new value.

Removes a given value or all values from a parameter.

@paramparamstring

The parameter name.

@paramvaluestring | number | boolean | undefined

The value to remove, if provided.

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

@returnsstring

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.