http_client 0.4.4+1 copy "http_client: ^0.4.4+1" to clipboard
http_client: ^0.4.4+1 copied to clipboard

outdatedDart 1 only

A platform-independent HTTP client API supporting browser, console, and curl (for SOCKS proxy).

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 {
  http.Client client = new 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() {
  http.Client client = new http.BrowserClient();
  // use the client, eg.:
  // new MyServiceClient(client)
  await client.close();
}
15
likes
0
pub points
88%
popularity

Publisher

verified publisheragilord.com

A platform-independent HTTP client API supporting browser, console, and curl (for SOCKS proxy).

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

executor

More

Packages that depend on http_client