Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vycius/dio_brotli_transformer
Brotli support for Dio http client
https://github.com/vycius/dio_brotli_transformer
brotli dio
Last synced: 2 months ago
JSON representation
Brotli support for Dio http client
- Host: GitHub
- URL: https://github.com/vycius/dio_brotli_transformer
- Owner: vycius
- License: apache-2.0
- Created: 2020-12-21T16:00:39.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-08T12:18:58.000Z (about 1 year ago)
- Last Synced: 2024-10-05T19:21:39.095Z (3 months ago)
- Topics: brotli, dio
- Language: Dart
- Homepage: https://pub.dev/packages/dio_brotli_transformer
- Size: 43 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Dio Brotli transformer
[![Pub](https://img.shields.io/pub/v/dio_brotli_transformer.svg?style=flat-square)](https://pub.dev/packages/dio_brotli_transformer)
Brotli response support for Dio http client
## Get started
### Installation
In `pubspec.yaml` add the following dependency:
```yaml
dependencies:
dio_brotli_transformer: ^2.0.0
```### Super simple to use
```dart
import 'package:dio/dio.dart';
import 'package:dio_brotli_transformer/dio_brotli_transformer.dart';final dio = Dio(
BaseOptions(
headers: {
'accept-encoding': 'br',
},
),
);dio.transformer =
DioBrotliTransformer();
```## Examples
### Change default transformer
```dart
import 'package:dio/dio.dart';
import 'package:dio_brotli_transformer/dio_brotli_transformer.dart';final dio = Dio(
BaseOptions(
headers: {
'accept-encoding': 'br',
},
),
);dio.transformer = DioBrotliTransformer
(
transformer
:
DefaultTransformer
(
)
);
```