Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkgs/http/lib/src/io_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ class IOClient extends BaseClient {
/// The underlying `dart:io` HTTP client.
HttpClient? _inner;

/// Create a new `dart:io`-based HTTP [Client].
///
/// If [inner] is provided then it can be used to provide configuration
/// options for the client.
///
/// For example:
/// ```dart
/// final httpClient = HttpClient()
/// ..userAgent = 'Book Agent'
/// ..idleTimeout = const Duration(seconds: 5);
/// final client = IOClient(httpClient);
/// ```
IOClient([HttpClient? inner]) : _inner = inner ?? HttpClient();

/// Sends an HTTP request and asynchronously returns the response.
Expand Down