fetch_client 1.1.2 fetch_client: ^1.1.2 copied to clipboard
Client for http package based on Fetch API, enables streamed and cancelable requests on web and more.
example/fetch_client_example.dart
import 'dart:convert';
import 'package:fetch_client/fetch_client.dart';
import 'package:http/http.dart';
void main() async {
final client = FetchClient(mode: RequestMode.cors);
final uri = Uri.https('jsonplaceholder.typicode.com', '/todos/1');
final response = await client.send(Request('GET', uri));
print(response.redirected);
print(response.url);
print(await utf8.decodeStream(response.stream));
}