HttpParams
HTTP 请求/响应体,用来表示序列化参数,它们的 MIME 类型都是 application/x-www-form-urlencoded
。
An HTTP request/response body that represents serialized parameters, per the MIME type application/x-www-form-urlencoded
.
class HttpParams {
constructor(options: HttpParamsOptions = {} as HttpParamsOptions)
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
}
说明
这个类是不可变的 - 每个修改类的操作都会返回一个新实例。
This class is immutable; all mutation operations return a new instance.
构造函数
方法
Reports whether the body includes one or more values for a given parameter. |
Retrieves the first value for a parameter. |
Retrieves all values for a parameter. |
Retrieves all the parameters for this body. |
参数没有参数。 返回值
|
Appends a new value to existing values for a parameter. | ||||||
参数
返回值构造一个新的
|
Replaces the value for a parameter. | ||||||
参数
返回值构造一个新的
|
Removes a given value or all values from a parameter. | ||||||
参数
返回值构造一个新的
|
把该 Serializes the body to an encoded string, where key-value pairs (separated by |
参数没有参数。 返回值
|