Skip to main content
interface Deno.HttpConn
implements AsyncIterable<RequestEvent>, Disposable

The async iterable that is returned from Deno.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.