A response to a http request.

Note: if you dont consume the response body you should call Response.body.close() (this is done automatically after 30 seconds if you don't, but if you're sending a lot of requests its better to do it yourself)

Constructors

Properties

Methods

Constructors

  • Parameters

    • statusCode: number
    • headers: Record<string, string>
    • Optional body: AsyncReadCloser

    Returns Response

Properties

headers: Record<string, string>
statusCode: number

Methods

  • Read and decode the response body as json

    Type Parameters

    • T

    Returns Promise<T>

  • Read the entire response body and return the raw Uint8Array for it.

    Returns Promise<Uint8Array>

  • Read and decode the reponse body as utf8 encoded text

    Returns Promise<string>

Generated using TypeDoc