Vapor Documentation

Structure Client​Response

public struct ClientResponse  
%15 ClientResponse ClientResponse Equatable Equatable ClientResponse->Equatable ResponseEncodable ResponseEncodable ClientResponse->ResponseEncodable CustomStringConvertible CustomStringConvertible ClientResponse->CustomStringConvertible AsyncResponseEncodable AsyncResponseEncodable ClientResponse->AsyncResponseEncodable Codable Codable ClientResponse->Codable

Conforms To

AsyncResponseEncodable

Can convert self to a Response.

ResponseEncodable

Can convert self to a Response.

Codable
CustomStringConvertible
Equatable

Initializers

init(status:​headers:​body:​byte​Buffer​Allocator:​)

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

init(from:​)

public init(from decoder: Decoder) throws  

Properties

status

public var status: HTTPStatus

headers

public var headers: HTTPHeaders

body

public var body: ByteBuffer? 

content

public var content: ContentContainer  

description

public var description: String  

Methods

encode​Response(for:​)

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

encode(to:​)

public func encode(to encoder: Encoder) throws  

encode​Response(for:​)

@available(macOS 12, iOS 15, watchOS 8, tvOS 15, *)
    public func encodeResponse(for request: Request) async throws -> Response  

Operators

==

public static func == (lhs: Self, rhs: Self) -> Bool