webfetch 0.0.16 copy "webfetch: ^0.0.16" to clipboard
webfetch: ^0.0.16 copied to clipboard

A Dart implementation of the Web Fetch API that allows you to make requests and process results just like using fetch in a browser.

example/main.dart

import 'package:webfetch/webfetch.dart';

void main() async {
  final formData = FormData();
  formData.append('name', 'John Doe');
  formData.append('age', '42');

  final blob = Blob(['Hello, World!'], type: 'text/plain');
  formData.append('file', blob, 'hello.txt');

  final headers = Headers();
  headers.append('x-multiple', 'Value 1');
  headers.append('x-multiple', 'Value 2');

  final response = await fetch(
    'https://webhook.site/9e179866-34ba-487d-8538-7c69ca963a01',
    method: "POST",
    body: formData,
    keepalive: true,
    headers: headers,
  );

  print(await response.text());
}
3
likes
130
pub points
45%
popularity

Publisher

verified publisherodroe.com

A Dart implementation of the Web Fetch API that allows you to make requests and process results just like using fetch in a browser.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

mime, web

More

Packages that depend on webfetch