Skip to content

Fast request options

FastAxiosRequestConfig<Input> extends AxiosRequestConfig<Input> with the following options.

requestType Mode

Required. Matches the Fast.NET HttpRequestActionEnum OpenAPI output:

ts
type RequestType = "auth" | "query" | "add" | "edit" | "delete" | "submit" | "upload" | "download" | "export" | "import" | "callback" | "other";

download and export enter Fast file-response handling. The uni adapter selects file APIs using method: "upload" | "download".

Extension options

OptionDefaultBehavior
cancelDuplicateRequesttrueDeduplicates supported bodies using final URL, method and headers; opaque file bodies require an explicit key.
loadingfalseCalls loading show/close during the request lifecycle.
loadingText"加载中..." (Chinese loading message)Text passed to loading show.
cachefalseEnables eligible GET RESTful caching only with an explicit nonempty namespace.
getMethodCacheHandletrueAdds a timestamp parameter to unencrypted GET requests to avoid browser/proxy response reuse.
simpleDataFormattrueReturns only data for successful RESTful JSON responses.
showErrorMessagetrueDisplays HTTP, network, and timeout errors.
showCodeMessagetrueDisplays Fast business code/success errors.
autoDownloadFiletrueAutomatically saves successful browser file responses.
requestCipherGlobal configurationCalls registered request-encryption and response-decryption handlers.
restfulResulttrueValidates code/success and processes data according to ApiResponse.
cacheNamespaceContainer namespaceNonempty identity/tenant/language scope; empty disables request caching.
duplicateKeyUnsetExplicit deduplication identity for opaque/file bodies; do not include raw credentials.

Return rules

ConditionResult
Custom response handler returns a non-nullish valueCustom return value
method: "download" or requestType: "download"Complete AxiosResponse
requestType: "export" or Blob response typeComplete AxiosResponse
Non-JSON + simpleDataFormat: trueresponse.data
Non-JSON + simpleDataFormat: falseComplete AxiosResponse
JSON + RESTful + simplified modedata from the decrypted structure
Other JSONDecrypted or original response data

Throws AxiosError when the business code is outside 200–299 or success is false. Cancellation preserves Axios CanceledError so callers can continue using axios.isCancel().

Boundary behavior

Null/undefined JSON or decrypted values are returned unchanged; other non-object RESTful payloads produce a protocol error. URLSearchParams duplicates and the caller-owned object are preserved. showErrorMessage covers offline and file HTTP failures, independently of showCodeMessage for business protocol failures.