supportedCapabilities
Specifies the set of capabilities supported by this HTTP client engine.
Capabilities provide a mechanism for plugins and other components to determine whether the engine supports specific features such as timeouts, WebSocket communication, HTTP/2, HTTP/3, or other advanced networking capabilities. This allows seamless integration of features based on the engine's functionality.
Each capability is represented as an instance of HttpClientEngineCapability, which can carry additional metadata or configurations for the capability.
Example:
override val supportedCapabilities: Set<HttpClientEngineCapability<*>> = setOf(
WebSocketCapability,
Http2Capability,
TimeoutCapability
)
Usage in Plugins: Plugins can check if the engine supports a specific capability before applying behavior:
if (engine.supportedCapabilities.contains(WebSocketCapability)) {
// Configure WebSocket-specific settings
}
When implementing a custom engine, ensure this property accurately reflects the engine's abilities to avoid unexpected plugin behavior or runtime errors.