An open API service indexing awesome lists of open source software.

https://github.com/f3ath/dart-http-interop-http

Interop-compatible wrapper over the standard Dart http package
https://github.com/f3ath/dart-http-interop-http

Last synced: 5 months ago
JSON representation

Interop-compatible wrapper over the standard Dart http package

Awesome Lists containing this project

README

          

# http_interop_http

[Interop]-compatible wrapper over the standard Dart http package.

```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 main() async {
final client = http.Client();
final request = Request(
'get',
Uri.parse('https://example.com'),
Body(),
Headers.from({
'User-Agent': ['R2-D2']
}));
final response = await client.handleInterop(request);
client.close(); // Don't forget to close the client.
print(response.statusCode);
print(response.headers);
print(await response.body.decode(utf8));
}

```

[Interop]: https://pub.dev/packages/http_interop