API reference
Preparing search index…

HttpResponse

HTTP response status, header fields, and body.

Source & inheritance
Member directory8

Constructors

Properties

Methods

Constructors

  • Construct a response, indicating connection failure by default; fields keys should be lowercase.

    Parameters

    status
    HttpStatus = HttpStatus.ConnectionFailed
    fields
    ReadonlyMap<string, string> = ...
    body
    Buffer = ...
    major
    number = 0
    minor
    number = 0

    Returns

    Source & inheritance

Properties

Status: typeof HttpStatus = HttpStatus

HTTP response status enumeration.

Source & inheritance

Methods

  • Decode the response body as a UTF-8 string.

    Returns

    string
    Source & inheritance
  • Return an independent copy of the raw response body bytes.

    Returns

    Uint8Array
    Source & inheritance
  • Read a response header by case-insensitive name; return an empty string if absent.

    Parameters

    field
    string

    Returns

    string
    Source & inheritance
  • Return the response's HTTP major version.

    Returns

    number
    Source & inheritance
  • Return the response's HTTP minor version.

    Returns

    number
    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0