fetch_client 1.2.0 copy "fetch_client: ^1.2.0" to clipboard
fetch_client: ^1.2.0 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));
}
42
likes
160
points
90.8k
downloads

Documentation

API reference

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

License

ISC (license)

Dependencies

fetch_api, http

More

Packages that depend on fetch_client