http_interop_http 0.6.0 http_interop_http: ^0.6.0 copied to clipboard
Interop-compatible wrapper over the standard Dart http package
import 'dart:convert';
import 'package:http_interop/extensions.dart';
import 'package:http_interop/http_interop.dart';
import 'package:http_interop_http/http_interop_http.dart';
Future<void> main() async {
final handler = OneOffHandler();
final request = Request(
Method('get'),
Uri.parse('https://example.com'),
Body.empty(),
Headers({
'User-Agent': ['R2-D2']
}));
final response = await handler.handle(request);
print(response.statusCode);
print(response.headers);
print(await response.body.decode(utf8));
}