Skip to main content

http_interop_http 0.10.0 copy "http_interop_http: ^0.10.0" to clipboard
http_interop_http: ^0.10.0 copied to clipboard

Interop-compatible wrapper over the standard Dart http package

example/example.dart

import 'dart:convert';

import 'package:http/http.dart' as http;
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 client = http.Client();
  final request = Request(
    'get',
    Uri.parse('https://example.com'),
    Body.empty(),
    Headers.from({
      'User-Agent': ['R2-D2'],
    }),
  );
  final response = await client.sendInterop(request);
  client.close(); // Don't forget to close the client.
  print(response.statusCode);
  print(response.headers);
  print(await response.body.decode(utf8));
}
1
likes
160
points
1.06k
downloads

Documentation

API reference

Publisher

verified publisherkarapetov.com

Weekly Downloads

Interop-compatible wrapper over the standard Dart http package

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

http, http_interop

More

Packages that depend on http_interop_http