cinch
library
Classes
ApiService
API標籤
BaseOptions
The common config for the Dio instance.
dio.options
is a instance of BaseOptions
CancelToken
You can cancel a request by using a cancel token.
One token can be shared with different requests.
when a token's cancel method invoked, all requests
with this token will be cancelled.
DefaultTransformer
Delete
Http Delete
Dio
A powerful Http client for Dart, which supports Interceptors,
Global configuration, FormData, File downloading etc. and Dio is
very easy to use.
DioMixin
ErrorInterceptorHandler
Handler for error interceptor.
Field
Http Field 搭配 fromUrlEncoded使用
FormData
A class to create readable "multipart/form-data" streams.
It can be used to submit forms and file uploads to http server.
Get
Http Get
Http
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
Interceptor
Dio instance may have interceptor(s) by which you can intercept
requests/responses/errors before they are handled by then
or catchError
.
See also:
Interceptors
Interceptors are a queue, and you can add any number of interceptors,
All interceptors will be executed in first in first out order.
InterceptorsWrapper
InterceptorsWrapper is a helper class, which is used to conveniently
create interceptor(s).
See also:
ListParam <T >
Lock
Add lock/unlock API for interceptors.
LogInterceptor
LogInterceptor is used to print logs during network requests.
It's better to add LogInterceptor to the tail of the interceptor queue,
otherwise the changes made in the interceptor behind A will not be printed out.
This is because the execution of interceptors is in the order of addition.
MultipartFile
A file to be uploaded as part of a MultipartRequest
. This doesn't need to
correspond to a physical file.
Options
Every request can pass an Options object which will be merged with Dio.options
Pair <F , S >
內含兩個資料
Parameter
Part
Multipart 資料
Path
路徑格式化
Post
Http Post
Put
Http Put
Query
Http Query
QueuedInterceptor
Serialize the request/response/error before they enter the interceptor.
QueuedInterceptorsWrapper
QueuedInterceptorsWrapper is a helper class, which is used to conveniently
create QueuedInterceptor(s).
See also:
RedirectRecord
RequestInterceptorHandler
Handler for request interceptor.
RequestOptions
Response <T >
Response describes the http Response info.
ResponseBody
ResponseInterceptorHandler
Handler for response interceptor.
Service
藉由build_runner實現
Transformer
Transformer allows changes to the request/response data before
it is sent/received to/from the server.
Triple <F , S , T >
內含三個資料
Enums
DioErrorType
ListFormat
ListFormat specifies the array format
(a single parameter with multiple parameter or multiple parameters with the same name)
and the separator for array items.
ResponseType
ResponseType indicates which transformation should
be automatically applied to the response data by Dio.
Constants
formUrlEncoded
→ const _FormUrlEncoded
application/x-www-form-urlencoded
multipart
→ const _Multipart
multipart/form-data
partMap
→ const _PartMap
Multipart 資料 Map 形式
Exceptions / Errors
DioError
DioError describes the error info when request failed.