Guide · Open source
How to use dio: an HTTP client for Dart and Flutter
Updated · written with AI from the project's own documentation and checked against our catalogue data
Dio is an HTTP client package for Dart and Flutter that app developers use to send requests to web servers and receive responses. This page explains what the cfug/dio repository contains, where the actual package lives, and which features the project's description lists. By the end you will know where to start, what you need installed, and whether dio fits your project.
Quick start
- 1Install the Dart or Flutter SDK. Dio needs the Dart SDK or the Flutter SDK. Install whichever matches your project.
- 2Clone the repository. Run git clone https://github.com/cfug/dio to get the source locally.
- 3Open the dio package folder. The README points to specific paths for project instructions, so go to the dio folder inside the repo.
- 4Read the package documentation. Visit https://dio.pub for the package documentation and the Migration Guide.
- 5Try an example. Open example_dart or example_flutter_app to see the package in use.
- 6Add dio to your project. Use your SDK's package manager to add dio to your project, following the instructions in the dio folder.
What the cfug/dio repository contains
The cfug/dio repository is the base repo of the dio project. It does not hold the package code itself. The README says to move to specific paths for project instructions.
- dio: the main package, in the dio folder
- Plugins: cookie_manager, compatibility_layer, http2_adapter, native_dio_adapter and web_adapter, each in its own folder under plugins
- Examples: example_dart and example_flutter_app
Check the prerequisites before you start
Dio is a Dart package, so you need either the Dart SDK or the Flutter SDK installed. The project is written in Dart. Dio is aimed at Flutter app developers calling web APIs and at Dart developers writing server-side or command-line code that makes HTTP calls.
- Dart SDK or Flutter SDK
- Basic familiarity with Dart or Flutter code
- Read the Migration Guide before upgrading, since breaking changes can appear in major and minor versions
Get the code and find the package instructions
The README gives no install command for the package. To get the repository locally, clone it. Then open the dio folder and follow the instructions there, because the README points to specific paths for project instructions. Package installation is handled through the package manager of your SDK.
- Clone the repository, then open the dio subfolder for the package instructions
- Follow the Migration Guide and Compatibility Policy linked from the README when upgrading
git clone https://github.com/cfug/dioKnow the features the project lists
According to the project description, dio supports global settings, interceptors, FormData, aborting and canceling requests, file uploads and downloads, request timeouts, and custom adapters. The README itself does not detail the full API, so check the package documentation at dio.pub for how each feature is used.
- Global settings
- Interceptors
- FormData
- Aborting and canceling requests
- File uploads and downloads
- Request timeouts
- Custom adapters
Choose between dio and similar packages
Comparable projects include http, chopper and retrofit. Dio is the choice when your project needs the listed features such as interceptors, cancellable requests or file transfer handling. If you only need simple requests, a lighter option may be enough. The README does not compare these projects directly, so review each one against your needs.
- Pick dio for interceptors, cancellable requests, and upload or download handling
- Compare with http, chopper and retrofit for simpler or differently structured needs
What people use it for
- Calling web APIs from a Flutter app
- Making HTTP calls from server-side Dart code
- Building command-line tools that send HTTP requests
- Uploading and downloading files over HTTP
- Cancelling in-flight requests or setting timeouts
Frequently asked questions
How do I install dio?
The README gives no install command for the package. Clone the repository with git clone https://github.com/cfug/dio, then follow the instructions in the dio folder. You need the Dart SDK or Flutter SDK.
Is dio free to use?
The project is licensed under the MIT license, as stated in the repository. Check the LICENSE file in the repo for the full terms.
What do I need to run dio?
Dio is a Dart package, so you need the Dart SDK or the Flutter SDK. It is intended for Dart and Flutter code.
What are the alternatives to dio?
Comparable projects include http, chopper and retrofit. Each has its own approach, so compare them against the features your project needs.
Can dio upload and download files?
The project description lists file uploading and downloading, along with FormData. See the dio package documentation at dio.pub for usage details.
Where is the dio documentation?
The homepage is https://dio.pub. The README also links a Migration Guide and a Compatibility Policy document for upgrade planning.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Dio suits Flutter and Dart developers who need interceptors, cancellable requests, timeouts, or file transfers over HTTP. People who do not write Dart or Flutter code, or who want an end-user app, should choose something else. Simple projects may find a lighter package such as http easier.
Install options & downloads