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

API Browser

Method

ServeOne

func ServeOne(handler: (HttpRequest) -> Task<Result<HttpResponse, HttpError>>, cancellationToken: CancellationToken = default) -> Task<Result<void, HttpError>>

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

Handles one accepted context and sends the callback's buffered or known-length stream response. Cancellation ends this exchange, including an outstanding handler wait.

Parameters

Name Type Description
handler Function
cancellationToken CancellationToken

Return value

Task<Result<void, HttpError>>