Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface HttpResponse

An HttpResponse is valid until either onAborted callback or any of the .end/.tryEnd calls succeed. You may attach user data to this object.

Hierarchy

  • HttpResponse

Index

Methods

end

  • end(body: string): void
  • Ends this response by copying the contents of body.

    Parameters

    • body: string

    Returns void

tryEnd

  • tryEnd(fullBodyOrChunk: string, totalSize: number): [boolean, boolean]
  • Ends this response, or tries to, by streaming appropriately sized chunks of body. Use in conjunction with onWritable. Returns tuple [ok, hasResponded].

    Parameters

    • fullBodyOrChunk: string
    • totalSize: number

    Returns [boolean, boolean]

writeHeader

  • writeHeader(key: string, value: string): void
  • Parameters

    • key: string
    • value: string

    Returns void

Generated using TypeDoc