Class: WrapperAxios<T>
core/useAxios.WrapperAxios
包装器类。
Type parameters
Name | Type |
---|---|
T | AxiosRequestConfig |
Constructors
constructor
• new WrapperAxios<T
>(axios
)
Type parameters
Name | Type |
---|---|
T | AxiosRequestConfig <any > |
Parameters
Name | Type |
---|---|
axios | AxiosInstance |
Properties
#axios
• Private
Readonly
#axios: AxiosInstance
Accessors
self
• get
self(): AxiosInstance
axios
实例。
Returns
AxiosInstance
Methods
delete
▸ delete(url
, config?
): Promise
<any
>
用于删除指定的资源。
Parameters
Name | Type |
---|---|
url | string |
config? | T |
Returns
Promise
<any
>
get
▸ get(url
, params?
, config?
): Promise
<any
>
请求指定的资源。使用GET
的请求应该只用于获取数据。
Parameters
Name | Type |
---|---|
url | string |
params? | Dictionary <any > |
config? | T |
Returns
Promise
<any
>
head
▸ head(url
, config?
): Promise
<any
>
请求资源的标头信息,并且这些标头与GET
方法请求时返回的一致。
Parameters
Name | Type |
---|---|
url | string |
config? | T |
Returns
Promise
<any
>
options
▸ options(url
, config?
): Promise
<any
>
用于获取目的资源所支持的通信选项。
Parameters
Name | Type |
---|---|
url | string |
config? | T |
Returns
Promise
<any
>
patch
▸ patch(url
, data?
, config?
): Promise
<any
>
用于对资源进行部分修改。
Parameters
Name | Type |
---|---|
url | string |
data? | unknown |
config? | T |
Returns
Promise
<any
>
post
▸ post(url
, data?
, config?
): Promise
<any
>
发送数据给服务器。请求主体的类型由Content-Type
首部指定。
Parameters
Name | Type |
---|---|
url | string |
data? | unknown |
config? | T |
Returns
Promise
<any
>
put
▸ put(url
, data?
, config?
): Promise
<any
>
使用请求中的负载创建或者替换目标资源。
Parameters
Name | Type |
---|---|
url | string |
data? | unknown |
config? | T |
Returns
Promise
<any
>
request
▸ request(config
): Promise
<any
>
使用自定义配置发起axios
请求。
Parameters
Name | Type |
---|---|
config | T |
Returns
Promise
<any
>