fetch_client 1.0.2 copy "fetch_client: ^1.0.2" to clipboard
fetch_client: ^1.0.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));
}
18
likes
130
pub points
92%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

Topics

#fetch #http

Documentation

API reference

License

ISC (LICENSE)

Dependencies

fetch_api, http

More

Packages that depend on fetch_client