enableHttp2 property

bool enableHttp2
final

Whether to negotiate HTTP/2 (with automatic HTTP/1.1 fallback) on the native (dart:io) transport.

Defaults to true. When true, requests use HTTP/2 if the origin negotiates h2 via TLS ALPN, otherwise they transparently fall back to HTTP/1.1. Set to false to always use HTTP/1.1 (e.g. behind a proxy that is not detected from the environment). Has no effect on the web platform, where the browser controls the protocol.

Implementation

final bool enableHttp2;