diff options
Diffstat (limited to 'cli/dts/lib.deno.unstable.d.ts')
-rw-r--r-- | cli/dts/lib.deno.unstable.d.ts | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 9dbe6817f..91e6825b0 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -1211,18 +1211,20 @@ declare namespace Deno { /** **UNSTABLE**: new API, yet to be vetted. * - * Parse HTTP requests from the given connection + * Services HTTP requests given a TCP or TLS socket. * * ```ts - * const httpConn = await Deno.startHttp(conn); - * const { request, respondWith } = await httpConn.next(); - * respondWith(new Response("Hello World")); + * const httpConn = Deno.serveHttp(conn); + * const e = await httpConn.nextRequest(); + * if (e) { + * e.respondWith(new Response("Hello World")); + * } * ``` * - * If `httpConn.next()` encounters an error or returns `done == true` then - * the underlying HttpConn resource is closed automatically. + * If `httpConn.nextRequest()` encounters an error or returns `null` + * then the underlying HttpConn resource is closed automatically. */ - export function startHttp(conn: Conn): HttpConn; + export function serveHttp(conn: Conn): HttpConn; } declare function fetch( |