dio library

A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, File downloading etc. and Dio is very easy to use.

A open source project authorized by https://flutterchina.club.

Classes

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
The default Transformer for Dio. If you want to custom the transformation of request/response data, you can provide a Transformer by your self, and replace the DefaultTransformer by setting the dio.Transformer.
Dio
A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, File downloading etc. and Dio is very easy to use.
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
Interceptor
Each Dio instance has a interceptor by which you can intercept requests or responses before they are handled by then or catchError.
Options
The Options class describes the http request information and configuration.
RequestInterceptor
Each Dio instance has a RequestInterceptor and a ResponseInterceptor, by which you can intercept requests or responses before they are handled by then or catchError.
Response<T>
Response describes the http Response info.
ResponseInterceptor
Transformer
Transformer allows changes to the request/response data before it is sent/received to/from the server. This is only applicable for request methods 'PUT', 'POST', and 'PATCH'. [...]
UploadFileInfo
Describes the info of file to upload.

Enums

DioErrorType
ResponseType
ResponseType indicates which transformation should be automatically applied to the response data by Dio.

Typedefs

InterceptorCallback(Options options) → dynamic
InterceptorErrorCallback(DioError e) → dynamic
InterceptorsSuccessCallback(Response e) → dynamic
OnDownloadProgress(int received int total) → void
Callback to listen the file downloading progress. [...]
OnHttpClientCreate(HttpClient client) → dynamic
OnUploadProgress(int sent int total) → dynamic
Callback to listen request uploading progress. [...]
ValidateStatus(int status) → bool

Exceptions / Errors

DioError
DioError describes the error info when request failed.