UpgradeProtocol class
A single protocol entry in an Upgrade header.
protocol = protocol-name ["/" protocol-version]
protocol-name = token
protocol-version = token
protocol-version is therefore an opaque token (e.g. 13 for WebSocket,
2 for HTTP/2, 6.9 for IRC); it is not a number. Storing it as a string
preserves whatever the peer sent and avoids HTTP/2 and HTTP/2.0
collapsing into the same value on the wire.
Constructors
- UpgradeProtocol({required String protocol, String? version})
- Constructs an UpgradeProtocol instance with the specified name and version.
- UpgradeProtocol.parse(String value)
-
Parses a protocol string and returns an UpgradeProtocol instance.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- protocol → String
-
The name of the protocol (a token, e.g.
HTTP,WebSocket).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- version → String?
-
The version of the protocol (a token), or
nullwhen absent.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override