linkHttpParams
npm Package | @angular/common |
---|---|
Module | import { HttpParams } from '@angular/common/http'; |
Source | common/http/src/params.ts |
linkOverview
class HttpParams {
constructor(options: {} as {...})
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
}
linkDescription
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.
linkConstructor
constructor(options: {} as {
fromString?: string;
fromObject?: {
[param: string]: string | string[];
};
encoder?: HttpParameterCodec;
} = {} as {
fromString?: string;
fromObject?: {
[param: string]: string | string[];
};
encoder?: HttpParameterCodec;
})
linkMembers
has(param: string): boolean
Check whether the body has one or more values for the given parameter name.
get(param: string): string | null
Get the first value for the given parameter name, or null
if it's not present.
getAll(param: string): string[] | null
Get all values for the given parameter name, or null
if it's not present.
append(param: string, value: string): HttpParams
Construct a new body with an appended value for the given parameter name.
set(param: string, value: string): HttpParams
Construct a new body with a new value for the given parameter name.
delete(param: string, value?: string): HttpParams
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.