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

插件详情v1.6.0

http

一个可组合的、多平台的、基于 Future 的 HTTP 请求 API。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1510万
喜欢数
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 和 Web 服务集成。

适合场景

  • 使用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 项

源码仓库

使用此插件的项目

所在榜单