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.
构造函数
方法
检查 Check whether the body has one or more values for the given parameter name. |
获取给定参数名对应的第一个值,如果没有则返回 Get the first value for the given parameter name, or |
获取给定参数名对应的所有值,如果没有则返回 Get all values for the given parameter name, or |
获取此 Get all the parameter names for this body. |
构造一个新的 Construct a new body with an appended value for the given parameter name. |
构造一个新的 Construct a new body with a new value for the given parameter name. |
构造一个新的 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. | ||||||
参数
返回值 |
把该 Serialize the body to an encoded string, where key-value pairs (separated by |
参数没有参数。 返回值
|