fetch_client 1.1.1 copy "fetch_client: ^1.1.1" to clipboard
fetch_client: ^1.1.1 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));
}
36
likes
110
pub points
96%
popularity

Publisher

verified publishernull.moe

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