close method

  1. @override
void close()
inherited

Closes the client, canceling or closing any outstanding connections.

Implementation

@override
void close() {
  if (isClosed) return;
  _isClosed = true;
  closeClient();
  for (final request in _requests) {
    request.abort(Exception(
        'HTTP client was closed before this request could complete.'));
  }
}