fetch_client 1.1.2 copy "fetch_client: ^1.1.2" to clipboard
fetch_client: ^1.1.2 copied to clipboard

Platformweb

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));
}
36
likes
150
points
80.2k
downloads

Publisher

verified publishernull.moe

Weekly Downloads

Client for http package based on Fetch API, enables streamed and cancelable requests on web and more.

Repository (GitHub)
View/report issues

Topics

#web #fetch #http

Documentation

API reference

License

ISC (license)

Dependencies

fetch_api, http

More

Packages that depend on fetch_client