搜尋套件、儲存庫與 APP 分類

套件詳情v1.6.0

http

一個可組合的、多平台的、基於 Future 的 HTTP 請求 API。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1440萬
喜歡數
8480
Pub 分數
160

安裝套件

flutter pub add http

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

http 套件為 Dart 與 Flutter 應用程式提供了一種彈性且跨平台的 HTTP 請求解決方案。基於 Futures 建構,支援在 Android、iOS、Web、macOS、Windows 與 Linux 上進行同步與非同步作業。此套件強調組合性,讓開發者能輕鬆建立並管理帶有自訂標頭、逾時設定與攔截器的 HTTP 客戶端。它簡化了常見任務,例如 GET、POST、PUT 與 DELETE 請求,非常適合整合 RESTful API 與網路服務。

適用情境

  • 使用REST API
  • 發送表單數據
  • 處理 JSON 回應
  • 發送經過驗證的請求
  • 串流檔案下載
  • 攔截 HTTP 呼叫

主要特色

  • 基於未來的 API
  • 多平台支援
  • 可自定義的客戶端實例
  • 內建 JSON 處理
  • 請求/回應攔截
  • 支援標頭和驗證

適合對象

  • Flutter 移動應用
  • Web 應用程式
  • 桌面應用程式
  • API 結合專案
  • 後端服務通訊

使用建議

  • 需要手動錯誤處理
  • 無內建快取
  • 僅限基本的HTTP操作
  • 不適合複雜的網路場景
  • 依賴外部依賴項以實現進階功能
  • 不包含 WebSocket 支援

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Build Status

A composable, Future-based library for making HTTP requests.

package:http contains a set of high-level functions and classes that make it easy to consume HTTP resources. It's multi-platform, and supports mobile, desktop, and the browser.

Packages

Package Description Version
cronet_http An Android Flutter plugin that provides access to the Cronet HTTP client. pub package
cupertino_http A macOS/iOS Flutter plugin that provides access to the Foundation URL Loading System. pub package
flutter_http_example An Flutter app that demonstrates how to configure and use package:http. —
http A composable, multi-platform, Future-based API for HTTP requests. pub package
http2 A HTTP/2 implementation in Dart. pub package
http_client_conformance_tests A library that tests whether implementations of package:http's Client class behave as expected.
http_multi_server A dart:io HttpServer wrapper that handles requests from multiple servers. pub package
http_parser A platform-independent package for parsing and serializing HTTP formats. pub package
http_profile A library used by HTTP client authors to integrate with the DevTools Network View. pub package
ok_http An Android Flutter plugin that provides access to the OkHttp HTTP client and the OkHttp WebSocket API. pub package
web_socket Any easy-to-use library for communicating with WebSockets that has multiple implementations. pub package
web_socket_channel StreamChannel wrappers for WebSockets. Provides a cross-platform WebSocketChannel API. package issues
web_socket_conformance_tests A library that tests whether implementations of package:web_socket's WebSocket class behave as expected.

Contributing

If you'd like to contribute to any of these packages, see the Contributing Guide.

所屬分類

依賴

依賴清單 4 項

原始碼儲存庫

使用此套件的專案

所在榜單