Vapor Documentation Beta

Structure Client​Response

public struct ClientResponse
%3 ClientResponse ClientResponse ResponseEncodable ResponseEncodable ClientResponse->ResponseEncodable Codable Codable ClientResponse->Codable CustomStringConvertible CustomStringConvertible ClientResponse->CustomStringConvertible

Conforms To

ResponseEncodable

Can convert self to a Response.

Codable
CustomStringConvertible

Initializers

init(status:​headers:​body:​)

public init(status: HTTPStatus = .ok, headers: HTTPHeaders = [:], body: ByteBuffer? = nil)

init(from:​)

public init(from decoder: Decoder) throws

Properties

status

var status: HTTPStatus

headers

var headers: HTTPHeaders

body

var body: ByteBuffer?

content

var content: ContentContainer

description

var description: String

Methods

encode​Response(for:​)

public func encodeResponse(for request: Request) -> EventLoopFuture<Response>

encode(to:​)

public func encode(to encoder: Encoder) throws