搜索插件、代码仓与 APP 分类

GitHub 代码仓Zekfad/fetch_client

fetch_client

基于获取的 HTTP 包客户端。

fetch_client 项目封面
星标
29
复刻
12
最近推送(UTC)
2026年4月3日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

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.

Yaroslav Vorobev GitHub avatar
GitHub 作者

Yaroslav Vorobev ↗

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

@ZeroNaNme & @ClownCoRussian Federation, Ryazan' Region, Skopin
语言Dart

分类

此仓库发布的插件

使用的依赖

依赖清单 7 项

  • fetch_api^2.2.0
  • http^1.5.0
  • build_runner开发依赖>=2.4.10
  • build_web_compilers开发依赖>=4.0.10
  • http_client_conformance_tests开发依赖{"git":{"url":"https://github.com/dart-lang/http","ref":"master","path":"pkgs/http_client_conformance_tests"}}
  • test开发依赖^1.25.5
  • zekfad_lints开发依赖^2.3.0

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗