Method CreateHubConnection
CreateHubConnection(string, params ReadOnlySpan<(string Name, object? Value)>)
Creates a new ApiHubConnection for the specified hub path with optional query string parameters. Default query parameters from GetDefaultQueryParams(string) are automatically merged with per-call parameters (per-call parameters with the same name take precedence). Session cookies and user agent are applied automatically on non-browser platforms.
Declaration
protected ApiHubConnection CreateHubConnection(string path, params ReadOnlySpan<(string Name, object? Value)> queryStringParams)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | The hub endpoint path relative to the base address. |
| ReadOnlySpan<(string Name, object Value)> | queryStringParams | Optional query string parameters to include in the hub connection URL. |
Returns
| Type | Description |
|---|---|
| ApiHubConnection |
CreateHubConnection(string, Action<HttpConnectionOptions>?, params ReadOnlySpan<(string Name, object? Value)>)
Creates a new ApiHubConnection for the specified hub path with optional connection options and query string parameters. Default query parameters from GetDefaultQueryParams(string) are automatically merged with per-call parameters (per-call parameters with the same name take precedence). Session cookies and user agent are applied automatically on non-browser platforms.
Declaration
protected virtual ApiHubConnection CreateHubConnection(string path, Action<HttpConnectionOptions>? configureOptions, params ReadOnlySpan<(string Name, object? Value)> queryStringParams)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | The hub endpoint path relative to the base address. |
| Action<HttpConnectionOptions> | configureOptions | Callback that configures the HttpConnectionOptions for the connection. |
| ReadOnlySpan<(string Name, object Value)> | queryStringParams | Optional query string parameters to include in the hub connection URL. |
Returns
| Type | Description |
|---|---|
| ApiHubConnection |