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

An adapter that combines HTTP/2 and dio. Supports reusing connections, header compression, etc.

example/example.dart

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

void main() async {
  final dio = Dio()
    ..options.baseUrl = 'https://pub.dev'
    ..interceptors.add(LogInterceptor())
    ..httpClientAdapter = Http2Adapter(
      ConnectionManager(idleTimeout: Duration(seconds: 10)),
    );

  Response<String> response;
  response = await dio.get('/?xx=6');
  for (final e in response.redirects) {
    print('redirect: ${e.statusCode} ${e.location}');
  }
  print(response.data);
}
37
likes
0
pub points
97%
popularity

Publisher

verified publisherflutter.cn

An adapter that combines HTTP/2 and dio. Supports reusing connections, header compression, etc.

Homepage
Repository (GitHub)
View/report issues

Topics

#dio #http2 #native #network

License

unknown (license)

Dependencies

dio, http2

More

Packages that depend on dio_http2_adapter