搜尋套件、儲存庫與 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 ↗