Skip to content

Class

Response

An HTTP response from a server back to the client.
final class Response

Overview

let res = Response(status: .ok)

See HTTPClient and HTTPServer.

Topics

Structures

Initializers

Instance Properties

  • body
    The Body. Updating this property will also update the associated transport headers.
  • content
  • cookies
    Get and set HTTPCookies for this Response. This accesses the "Set-Cookie" header.
  • description
    See CustomStringConvertible
  • headers
    The header fields for this HTTP response. The "Content-Length" and "Transfer-Encoding" headers will be set automatically when the body property is mutated.
  • status
    The HTTP response status.
  • storage
  • upgrader
    Optional Upgrade behavior to apply to this response. currently, websocket upgrades are the only defined case.
  • version
    The HTTP version that corresponds to this response.

Default Implementations

Relationships

Conforms To