Search packages, repositories and app categories

Package detailsv1.5.3

http_client

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

AndroidiOSWebmacOSWindowsLinux
30-day downloads
1.6K
Likes
16
Pub points
150

Install package

flutter pub add http_client

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The http_client package provides a platform-independent HTTP client API designed to work across multiple environments, including Android, iOS, Web, macOS, Windows, and Linux. It supports browser-based requests, console applications, and integrates with curl for SOCKS proxy usage, enabling consistent HTTP communication regardless of the target platform. Built with portability in mind, it abstracts underlying network implementations, making it ideal for cross-platform Flutter apps that require reliable and uniform HTTP interactions. The package is maintained by agilord.com and available via pub.dev.

Use cases

  • Cross-platform HTTP requests
  • Browser and native app integration
  • SOCKS proxy support via curl
  • Unified HTTP layer across platforms
  • Testing HTTP behavior in different environments
  • Backend service communication

Key features

  • Platform-agnostic HTTP API
  • Support for browser, console, and curl
  • SOCKS proxy compatibility
  • Consistent interface across devices
  • Lightweight and modular design
  • Built-in error handling

Suitable for

  • Developers building multi-platform Flutter apps
  • Teams needing consistent HTTP behavior
  • Applications requiring proxy support
  • Projects targeting web and mobile simultaneously
  • Use cases involving network abstraction

Considerations

  • Limited to basic HTTP methods (GET, POST, etc.)
  • No built-in JSON parsing (requires external handling)
  • Depends on underlying platform's networking capabilities
  • May require additional configuration for advanced proxy setups
  • Not intended for high-performance or complex HTTP scenarios

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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

Categories

Dependencies

Dependency list 3 items

Source repository

Projects using this package