v1.5.3
http_client
브라우저, 콘솔 및 curl(소크스 프록시용)을 지원하는 플랫폼 독립적인 HTTP 클라이언트 API입니다.
16좋아요 5.9천30일 다운로드150Pub 점수
AndroidiOSWebmacOSWindowsLinux
isoos/http_client open-source repository details.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A platform-independent HTTP client API supporting browser, console, and curl (for SOCKS proxy). Planned platforms: Fetch API, node_io.
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();
}