API reference
Preparing search index…

HttpRequest

Mutable HTTP/1 request, defaulting to GET /, HTTP/1.0, and an empty body.

Source & inheritance
Member directory8

Constructors

Properties

Methods

Constructors

  • Create a request from an encoded path, method, and body; string bodies are encoded as UTF-8.

    Parameters

    uri
    string = '/'
    method
    HttpMethod = HttpMethod.Get
    body
    string | Uint8Array = ''

    Returns

    Source & inheritance

Properties

Method: typeof HttpMethod = HttpMethod

Request method enumeration.

Source & inheritance

Methods

  • Copy request body bytes; encode strings as UTF-8.

    Parameters

    body
    string | Uint8Array

    Returns

    void
    Source & inheritance
  • Set a request header with a case-insensitive field name; invalid header names or values throw.

    Parameters

    field
    string
    value
    string

    Returns

    void
    Source & inheritance
  • Set the HTTP major and minor versions written to the request line.

    Parameters

    major
    number
    minor
    number

    Returns

    void
    Source & inheritance
  • Set the URL-encoded path and query string, adding a leading slash if missing.

    Parameters

    uri
    string

    Returns

    void
    Source & inheritance

Symbol members

  • Parameters

    host
    string

    Returns

    PreparedRequest
    Source & inheritance

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