Skip to content

Class: WrapperAxios<T>

core/useAxios.WrapperAxios

包装器类。

Type parameters

NameType
TAxiosRequestConfig

Constructors

constructor

new WrapperAxios<T>(axios)

Type parameters

NameType
TAxiosRequestConfig<any>

Parameters

NameType
axiosAxiosInstance

Properties

#axios

Private Readonly #axios: AxiosInstance

Accessors

self

get self(): AxiosInstance

axios实例。

Returns

AxiosInstance

Methods

delete

delete(url, config?): Promise<any>

用于删除指定的资源。

Parameters

NameType
urlstring
config?T

Returns

Promise<any>


get

get(url, params?, config?): Promise<any>

请求指定的资源。使用GET的请求应该只用于获取数据。

Parameters

NameType
urlstring
params?Dictionary<any>
config?T

Returns

Promise<any>


head(url, config?): Promise<any>

请求资源的标头信息,并且这些标头与GET方法请求时返回的一致。

Parameters

NameType
urlstring
config?T

Returns

Promise<any>


options

options(url, config?): Promise<any>

用于获取目的资源所支持的通信选项。

Parameters

NameType
urlstring
config?T

Returns

Promise<any>


patch

patch(url, data?, config?): Promise<any>

用于对资源进行部分修改。

Parameters

NameType
urlstring
data?unknown
config?T

Returns

Promise<any>


post

post(url, data?, config?): Promise<any>

发送数据给服务器。请求主体的类型由Content-Type首部指定。

Parameters

NameType
urlstring
data?unknown
config?T

Returns

Promise<any>


put

put(url, data?, config?): Promise<any>

使用请求中的负载创建或者替换目标资源。

Parameters

NameType
urlstring
data?unknown
config?T

Returns

Promise<any>


request

request(config): Promise<any>

使用自定义配置发起axios请求。

Parameters

NameType
configT

Returns

Promise<any>