WebTransportSessionRequest Class
A WebTransport CONNECT request a WebTransportListener received: accept or reject it.
public sealed class WebTransportSessionRequestProperties
| Name | Description |
|---|---|
| Authority | Gets the :authority of the request: the host and the port. |
| Headers | Gets the headers of the request, without the pseudo-headers. |
| Origin | Gets the value of the origin header, if any. |
| Path | Gets the :path of the request: the path and the query. |
| Protocols | Gets the application protocols the client offers (wt-available-protocols). |
| RemoteEndPoint | Gets the address of the client. |
Authority
WebTransportSessionRequest.csGets the headers of the request, without the pseudo-headers.
public IReadOnlyList<KeyValuePair<string, string>> Headers { get; }Property value
Protocols
WebTransportSessionRequest.csGets the application protocols the client offers (wt-available-protocols).
public IReadOnlyList<string> Protocols { get; }Property value
RemoteEndPoint
WebTransportSessionRequest.csMethods
| Name | Description |
|---|---|
| AcceptAsync(string?, IEnumerable<KeyValuePair<string, string>>?, CancellationToken) | Accepts the session with a 200 response. |
| RejectAsync(int, IEnumerable<KeyValuePair<string, string>>?, CancellationToken) | Rejects the session. |
AcceptAsync(string?, IEnumerable<KeyValuePair<string, string>>?, CancellationToken)
WebTransportSessionRequest.csAccepts the session with a 200 response.
net10.0
public ValueTask<WebTransportSession> AcceptAsync(string? protocol = null, IEnumerable<KeyValuePair<string, string>>? headers = null, CancellationToken cancellationToken = default)net11.0
public ValueTask<WebTransportSession> AcceptAsync(string? protocol = null, IEnumerable<KeyValuePair<string, string>>? headers = null, CancellationToken cancellationToken = default)Parameters
protocolstring?- The application protocol picked from
WebTransportSessionRequest.Protocols, sent inwt-protocol. headersIEnumerable<KeyValuePair<string, string>>?- Additional response headers.
cancellationTokenCancellationToken- The token to cancel the operation.
Returns
RejectAsync(int, IEnumerable<KeyValuePair<string, string>>?, CancellationToken)
WebTransportSessionRequest.csRejects the session.
net10.0
public ValueTask RejectAsync(int statusCode = 404, IEnumerable<KeyValuePair<string, string>>? headers = null, CancellationToken cancellationToken = default)net11.0
public ValueTask RejectAsync(int statusCode = 404, IEnumerable<KeyValuePair<string, string>>? headers = null, CancellationToken cancellationToken = default)Parameters
statusCodeint- The HTTP status code, outside 200-299.
headersIEnumerable<KeyValuePair<string, string>>?- Additional response headers.
cancellationTokenCancellationToken- The token to cancel the operation.