- apiFetch<ReqHeadersT, ReqParamsT, ReqQueryT, ReqBodyT, ResStatusT, ResHeadersT, ResBodyT, ErrResStatusT, ErrResHeadersT, ErrResBodyT>(api, req, __namedParameters?): Promise<ApiFetchResult<ResStatusT, ResHeadersT, ResBodyT, ErrResStatusT, ErrResHeadersT, ErrResBodyT>>
Type Parameters
- ReqHeadersT extends AnyHeaders
- ReqParamsT extends AnyParams
- ReqQueryT extends AnyQuery
- ReqBodyT extends unknown
- ResStatusT extends number
- ResHeadersT extends AnyHeaders
- ResBodyT extends unknown
- ErrResStatusT extends number
- ErrResHeadersT extends AnyHeaders
- ErrResBodyT extends unknown
Parameters
- api: HttpApi<ReqHeadersT, ReqParamsT, ReqQueryT, ReqBodyT, ResStatusT, ResHeadersT, ResBodyT, ErrResStatusT, ErrResHeadersT, ErrResBodyT>
- req: ApiRequest<ReqHeadersT, ReqParamsT, ReqQueryT, ReqBodyT>
- __namedParameters: ApiFetchOptions<ReqHeadersT, ReqParamsT, ReqQueryT, ReqBodyT, ResStatusT, ResHeadersT, ResBodyT, ErrResStatusT, ErrResHeadersT, ErrResBodyT> & {
context?: ApiRoutingContext;
} = {}
Uses
fetch
to access the specified API