Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Method

Send

abstract virtual func Send(request: HttpRequest, cancellationToken: CancellationToken = default) -> Task<Result<HttpResponse, HttpError>>

Declaring type: HttpHandler
Module: System.Web.Http
Assembly: System.Web.dll
Source file: HttpClient.rvn

Sends a prepared request with cooperative cancellation.

Parameters

Name Type Description
request HttpRequest A non-null parsed request; BaseUri is not applied.
cancellationToken CancellationToken An invocation-local request token, forwarded unchanged by handlers.

Return value

Task<Result<HttpResponse, HttpError>>

A response or HttpError, or an acknowledged cancelled Task.

Remarks

Development after Preview 9. Client and socket-handler pre-cancellation skips dispatch. The socket handler forwards this token through DNS, connect and transfers, consumes native completion and closes its owned connection before cancelling its task. A cancelled child task is observed before GetResult. A fully received native outcome can win over a late cancellation request; cancellation between successful phases prevents the next phase. DNS host work may continue under its capacity permit. Custom handlers must forward or honor the token and finish their own cleanup before cancellation completion. The client does not race custom handler tasks against tokens or dispose injected handlers. This replaces the former tokenless HttpHandler method; rebuild and migrate implementations.