Instance Method (Default implementation)vapor 4.114.1Vapor
beforeEncode
Content.swift:87mutating func beforeEncode() throws
mutating func beforeEncode() throws
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.
protocol Content : Decodable, Encodable, Sendable, AsyncRequestDecodable, AsyncResponseEncodable, RequestDecodable, ResponseEncodable
Convertible to / from content in an HTTP message.
mutating func beforeEncode() throws
Called before this Content
is encoded, generally for a Response
object.
static var defaultContentType: HTTPMediaType { get }
static func decodeRequest(_ request: Request) -> EventLoopFuture<Self>
static func decodeRequest(_ request: Request) async throws -> Self
mutating func afterDecode() throws
func encodeResponse(for request: Request) -> EventLoopFuture<Response>
func encodeResponse(for request: Request) async throws -> Response