FLUTTER ECOSYSTEM

Zekfad/fetch_client

Fetch based Client for HTTP package.

fetch_client project cover
Stars
29
Forks
12
Last push (UTC)
Apr 3, 2026
Project status
Active
Yaroslav Vorobev GitHub avatar
GITHUB User

Yaroslav Vorobev ↗

Bachelor of Software Engineering. Full-stack web and Dart/Flutter developer.

@ZeroNaNme & @ClownCoRussian Federation, Ryazan' Region, Skopin
LanguagesDart

Technical topics

Packages published by this repository

Dependencies used

Dependency list 7 items
  • fetch_api^2.2.0
  • http^1.5.0
  • build_runnerDevelopment>=2.4.10
  • build_web_compilersDevelopment>=4.0.10
  • http_client_conformance_testsDevelopment{"git":{"url":"https://github.com/dart-lang/http","ref":"master","path":"pkgs/http_client_conformance_tests"}}
  • testDevelopment^1.25.5
  • zekfad_lintsDevelopment^2.3.0

Original README

English project snapshot. Visit GitHub for the latest content.

Expand / collapse project README

Fetch Client

pub package package publisher

This package provides package:http client based on Fetch API with WASM support.

It's a drop-in solution for extensions with Manifest V3.

Features

  • WASM-ready internals.
  • Cancel requests.
  • Support data streaming:
    • Get response as Stream.
    • Optionally, send Stream as request body (supported only in Chromium 105+ based browsers).
  • Get access to redirect URL and status.
  • Support non-200 responses (fetch will only fail on network errors).
  • Simulate redirects responses via probe request and artificial location header.

Notes

Large payload

This module maps keepalive to BaseRequest.persistentConnection which is true by default.

Fetch spec says that maximum request size with keepalive flag is 64KiB:

4.5. HTTP-network-or-cache fetch

8.10.5: If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.

Source: Fetch. Living Standard — Last Updated 19 June 2023

Therefore if your request is larger than 64KiB (this includes some other data, such as headers) BaseRequest.persistentConnection will be ignored and treated as false.

Request streaming

Request streaming is supported only in Chromium 105+ based browsers and requires the server to use HTTP/2 or HTTP/3.

See MDN compatibility chart and Chrome Developers' blog for more info.