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
Response.BodyRepresents aResponse’s body.
Initializers
init(status:version:headers:body:)Creates a newResponse.init(status:version:headersNoUpdate:body:)Internal init that creates a newResponsewithout sanitizing headers.
Instance Properties
bodyTheBody. Updating this property will also update the associated transport headers.contentcookiesGet and setHTTPCookiesfor thisResponse. This accesses the"Set-Cookie"header.descriptionSeeCustomStringConvertibleheadersThe header fields for this HTTP response. The"Content-Length"and"Transfer-Encoding"headers will be set automatically when thebodyproperty is mutated.statusThe HTTP response status.storageupgraderOptional Upgrade behavior to apply to this response. currently, websocket upgrades are the only defined case.versionThe HTTP version that corresponds to this response.
Default Implementations
Relationships
Conforms To
AsyncResponseEncodableResponseEncodableSwift.CopyableSwift.CustomStringConvertibleSwift.EscapableSwift.SendableSwift.SendableMetatype