FLUTTER ECOSYSTEM

isoos/http_client

isoos/http_client open-source repository details.

http_client 项目封面
Stars
14
Forks
6
最近推送(UTC)
2023年10月6日
项目状态
未归档
István Soós GitHub avatar
GITHUB User

István Soós ↗

software engineer

@agilordBudapest, Hungary官方网站 ↗
语言Dart

此仓库发布的插件

使用的依赖

依赖清单 5 项

原始 README

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

展开 / 收起项目 README

Platform-independent HTTP client

A platform-independent HTTP client API supporting browser, console, and curl (for SOCKS proxy). Planned platforms: Fetch API, node_io.

Usage:

To develop your platform-agnostic library, use only the base import:

import 'package:http_client/http_client.dart' as http;

class MyServiceClient {
  final http.Client httpClient;
  MyServiceClient(this.httpClient);
}

For console apps:

import 'package:http_client/console.dart' as http;

main() async {
  final client = http.ConsoleClient();
  // use the client, eg.:
  // new MyServiceClient(client)
  await client.close();
}

For browser use, only change the first import:

import 'package:http_client/browser.dart' as http;

main() {
  final client = http.BrowserClient();
  // use the client, eg.:
  // new MyServiceClient(client)
  await client.close();
}