Protocolvapor 4.114.1Vapor
ResponseEncodable
Can convert self
to a Response
.
protocol ResponseEncodable
Browse conforming typesTypes that conform to this protocol can be returned in route closures.
Can convert self
to a Response
.
protocol ResponseEncodable
Types that conform to this protocol can be returned in route closures.
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
func encodeResponse(for request: Request) -> EventLoopFuture<Response>
Encodes an instance of Self
to a Response
.
func encodeResponse(status: HTTPStatus, headers: HTTPHeaders = [:], for request: Request) -> EventLoopFuture<Response>
Asynchronously encodes Self
into a Response
, setting the supplied status and headers.
protocol Content : Decodable, Encodable, Sendable, AsyncRequestDecodable, AsyncResponseEncodable, RequestDecodable, ResponseEncodable
Convertible to / from content in an HTTP message.