Deno.HttpConn - Deno documentation
interface Deno.HttpConn
extends AsyncIterable<RequestEvent>, Disposable

This will be removed in Deno 2.0. See the Deno 1.x to 2.x Migration Guide for migration instructions.

The async iterable that is returned from serveHttp which yields up RequestEvent events, representing individual requests on the HTTP server connection.


rid: number

The resource ID associated with this connection. Generally users do not need to be aware of this identifier.


nextRequest(): Promise<RequestEvent | null>

An alternative to the async iterable interface which provides promises which resolve with either a RequestEvent when there is another request or null when the client has closed the connection.

close(): void

Initiate a server side closure of the connection, indicating to the client that you refuse to accept any more requests on this connection.

Typically the client closes the connection, which will result in the async iterable terminating or the nextRequest() method returning null.