http_interop_dio 0.1.0 copy "http_interop_dio: ^0.1.0" to clipboard
http_interop_dio: ^0.1.0 copied to clipboard

Interop-compatible wrapper for Dio HTTP client

example/example.dart

import 'dart:convert';

import 'package:dio/dio.dart' as dio;
import 'package:http_interop/extensions.dart';
import 'package:http_interop/http_interop.dart';
import 'package:http_interop_dio/http_interop_dio.dart';

void main() async {
  final d = dio.Dio();
  final request =
      Request('get', Uri.parse('https://example.com'), Body(), Headers());
  final response = await ClientWrapper(d.httpClientAdapter).handle(request);
  print('Status code: ${response.statusCode}');
  print('Headers: ${response.headers}');
  print('Body: ${await response.body.decode(utf8)}');
}
0
likes
140
pub points
0%
popularity

Publisher

verified publisherkarapetov.com

Interop-compatible wrapper for Dio HTTP client

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dio, http_interop

More

Packages that depend on http_interop_dio