io library
The HTTP and WebSocket clients for platforms with dart:io (the Dart
VM, Flutter on mobile and desktop): IoHttpTransport on HttpClient,
and IoWebSocketTransport on dart:io's WebSocket.
Most applications never import this library. platformHttpTransport()
and platformWebSocketTransport() from
package:spring_web_dart/spring_web_dart.dart already pick these
transports outside the browser, and the Feign and WebSocket starters
call those functions. Import it when you need what only these
transports offer: an HttpClient of your own (proxy, certificates) or
headers in a WebSocket handshake.
import 'package:spring_web_dart/io.dart';
// Give up quickly when the server cannot be reached.
final transport =
IoHttpTransport(connectTimeout: const Duration(seconds: 3));
Spring (Java): JdkClientHttpRequestFactory, the client on the JDK's
HttpClient.
Classes
- IoHttpTransport
-
The HttpTransport for platforms with
dart:io(the Dart VM, Flutter on mobile and desktop), built ondart:io'sHttpClient. - IoWebSocketSession
-
A WebSocketSession over an open
dart:ioWebSocket, on either side of the connection. - IoWebSocketTransport
-
The WebSocketTransport for platforms with
dart:io(the Dart VM, Flutter on mobile and desktop), built ondart:io'sWebSocket.
Functions
-
webSocketAccept(
String key) → String -
The
Sec-WebSocket-Acceptvalue for aSec-WebSocket-Keykey(RFC 6455 §4.2.2): the base64 SHA-1 of the key and the protocol's GUID.