dio_http2_adapter 0.0.2 copy "dio_http2_adapter: ^0.0.2" to clipboard
dio_http2_adapter: ^0.0.2 copied to clipboard

outdated

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

example/example.dart

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

main() async {
  var dio = Dio()
    ..options.baseUrl = "https://www.ustc.edu.cn/"
    ..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);
  response = await dio.get("2062/list.htm");
  print(response.data);
}
37
likes
20
pub points
97%
popularity

Publisher

verified publisherflutter.cn

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

License

unknown (license)

Dependencies

dio, http2

More

Packages that depend on dio_http2_adapter