dio
5.11.1, released 3 months ago by flutter.cn
A powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
WASM-readyRock solid
What it does
Dio is an HTTP client for Dart and Flutter that supports global configurations, interceptors, FormData, request cancellation, file uploading and downloading, and custom adapters.
AI-written summary of version 5.11.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a full-featured HTTP client with advanced capabilities like interceptors and transformers
- You need to handle complex multipart file uploads and download progress tracking
Skip it when
- You only need to perform extremely basic HTTP requests and want to avoid third-party dependencies
Strengths
- Supports global configuration, interceptors, and custom adapters
- Built-in support for request cancellation and file upload/download progress
Weaknesses
- Heavier dependency footprint compared to the core `http` package
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 7
import 'package:dio/dio.dart';
final dio = Dio();
void getHttp() async {
final response = await dio.get('https://dart.dev');
print(response);
}Alternatives
Packages that do the same job and could replace dio.
Works with
Packages commonly used together with dio: ones it builds on, ones built on it, and its own family.
- mimedio depends on itUtilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.
- asyncdio depends on itUtility classes and helpers that extend Dart's async library.
- http_parserdio depends on itA platform-independent package for parsing and serializing HTTP formats.
- dio_web_adapterBuilt on dioWeb and WASM HTTP client adapter for Dio.
- retrofitBuilt on dioDart Dio client generator using source_gen
- retrofit_generatorBuilt on dioGenerates Dio client code from Retrofit‑style annotations.
- http_mock_adapterBuilt on dioA simple to use mocking package for Dio intended to be used in tests.
- pretty_dio_loggerBuilt on dioA Dio interceptor that logs network calls in a pretty, easy to read format.