Uno
Future based HTTP client for the Dart and Flutter.
Uno, inspired by Axios, bringing a simple and robust experience to the
crossplatform apps in Flutter and server apps in Dart.
Install
Add in your pubspec.yaml:
or use:
dart pub add uno
Usage
Uno is ready for the REST. Methods like GET, POST, PUT, PATCH, DELETE are welcome here!
Performing a GET
request:
Performing a POST
request:
uno API
Requests can be made by passing the relevant config to uno.
Creating an instance
Interceptors
You can intercept requests or responses before they are handled by then
or catch
:
If you need to remove an interceptor later you can.
If you want to execute a particular interceptor based on a runtime check, you can add a runWhen function to the options object. The interceptor will not be executed if and only if the return of runWhen is false. The function will be called with the config object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an asynchronous request interceptor that only needs to run at certain times.
Handling Errors
Using the validateStatus config option, you can define HTTP code(s) that should throw an error.
Multipart/FormData
You can use the form-data:
Features and bugs
Please file feature requests and bugs at the issue tracker.