@custouch/jssdk
Preparing search index...
service/request
FetchRequest
Class FetchRequest
Index
Constructors
constructor
Properties
base
Url?
init
interceptors?
timeout?
use
Data
Wrapper
Methods
delete
fetch
Factory
get
get
Rsp
get
Safe
Rsp
Body
headers
pass
Route
post
put
timeout
Abort
Constructors
constructor
new
FetchRequest
(
options
?:
{
baseUrl
?:
string
;
headers
?:
HeadersInit
;
init
?:
RequestInit
;
interceptors
?:
Interceptors
;
timeout
?:
number
;
useDataWrapper
?:
boolean
;
}
,
)
:
FetchRequest
Parameters
Optional
options
:
{
baseUrl
?:
string
;
headers
?:
HeadersInit
;
init
?:
RequestInit
;
interceptors
?:
Interceptors
;
timeout
?:
number
;
useDataWrapper
?:
boolean
;
}
Returns
FetchRequest
Properties
Optional
base
Url
baseUrl
?:
string
init
init
:
RequestInit
= {}
Optional
interceptors
interceptors
?:
Interceptors
拦截器
Optional
timeout
timeout
?:
number
= 10000
use
Data
Wrapper
useDataWrapper
:
boolean
= true
是否对结果进行序列话后返回
Methods
delete
delete
(
route
:
string
,
data
?:
string
|
any
[]
|
Record
<
string
,
any
>
,
options
?:
RequestOptions
,
)
:
Promise
<
any
>
Parameters
route
:
string
Optional
data
:
string
|
any
[]
|
Record
<
string
,
any
>
Optional
options
:
RequestOptions
Returns
Promise
<
any
>
fetch
Factory
fetchFactory
(
route
:
string
,
options
:
RequestInit
&
{
responseType
?:
"text"
|
"json"
|
"blob"
|
"arrayBuffer"
;
}
&
{
params
?:
null
|
Record
<
string
,
any
>
}
&
{
data
?:
any
}
,
)
:
Promise
<
any
>
Parameters
route
:
string
options
:
RequestInit
&
{
responseType
?:
"text"
|
"json"
|
"blob"
|
"arrayBuffer"
}
&
{
params
?:
null
|
Record
<
string
,
any
>
;
}
&
{
data
?:
any
}
Returns
Promise
<
any
>
get
get
(
route
:
string
,
options
?:
RequestOptions
)
:
Promise
<
any
>
Parameters
route
:
string
Optional
options
:
RequestOptions
Returns
Promise
<
any
>
get
Rsp
getRsp
(
rsp
:
Response
,
options
:
RequestOptions
)
:
Promise
<
any
>
Parameters
rsp
:
Response
options
:
RequestOptions
Returns
Promise
<
any
>
get
Safe
Rsp
Body
getSafeRspBody
(
rsp
:
Response
,
options
:
RequestOptions
)
:
Promise
<
any
>
|
Response
Parameters
rsp
:
Response
options
:
RequestOptions
Returns
Promise
<
any
>
|
Response
headers
headers
(
headers
?:
HeadersInit
)
:
HeadersInit
Parameters
Optional
headers
:
HeadersInit
Returns
HeadersInit
pass
Route
passRoute
(
route
:
string
)
:
string
Parameters
route
:
string
Returns
string
post
post
(
route
:
string
,
data
?:
string
|
any
[]
|
Record
<
string
,
any
>
,
options
?:
RequestOptions
,
)
:
Promise
<
any
>
Parameters
route
:
string
Optional
data
:
string
|
any
[]
|
Record
<
string
,
any
>
Optional
options
:
RequestOptions
Returns
Promise
<
any
>
put
put
(
route
:
string
,
data
?:
string
|
any
[]
|
Record
<
string
,
any
>
,
options
?:
RequestOptions
,
)
:
Promise
<
any
>
Parameters
route
:
string
Optional
data
:
string
|
any
[]
|
Record
<
string
,
any
>
Optional
options
:
RequestOptions
Returns
Promise
<
any
>
timeout
Abort
timeoutAbort
()
:
undefined
|
AbortSignal
Returns
undefined
|
AbortSignal
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
base
Url
init
interceptors
timeout
use
Data
Wrapper
Methods
delete
fetch
Factory
get
get
Rsp
get
Safe
Rsp
Body
headers
pass
Route
post
put
timeout
Abort
@custouch/jssdk
Loading...
拦截器