dio_http2_adapter 2.0.0
dio_http2_adapter: ^2.0.0 copied to clipboard

A Dio HttpClientAdapter which support Http/2.0(Support connection reuse, header compression, server pushing is not supported yet.)

Dependencies #

dependencies:
  dio: ^4.0.0
  dio_http2_adapter: ^2.0.0

Example #

import 'package:dio/dio.dart';
import 'package:dio_http2_adapter/dio_http2_adapter.dart';

void main() async {
  var dio = Dio()
    ..options.baseUrl = 'https://google.com'
    ..interceptors.add(LogInterceptor())
    ..httpClientAdapter = Http2Adapter(
      ConnectionManager(
        idleTimeout: 10000,
        // Ignore bad certificate
        onClientCreate: (_, config) => config.onBadCertificate = (_) => true,
      ),
    );

  Response<String> response;

  response = await dio.get('/?xx=6');
  print(response.data?.length);
  print(response.redirects.length);
  print(response.data);
}
7
likes
120
pub points
91%
popularity

Publisher

flutterchina.club

A Dio HttpClientAdapter which support Http/2.0(Support connection reuse, header compression, server pushing is not supported yet.)

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

dio, http2

More

Packages that depend on dio_http2_adapter