FLUTTER ECOSYSTEM

isoos/http_client

isoos/http_client open-source repository details.

Projektcover von http_client
Stars
14
Forks
6
Letzter Push (UTC)
06.10.2023
Projektstatus
Aktiv
István Soós GitHub avatar
GITHUB User

István Soós ↗

software engineer

@agilordBudapest, HungaryOffizielle Website ↗
SprachenDart

Von diesem Repository veröffentlichte Pakete

Verwendete Abhängigkeiten

Abhängigkeiten 5 Einträge

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

Projekt-README ein-/ausklappen

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();
}