Structure
Response
An HTTP response from a server back to the client.
struct Response
Overview
let res = Response(status: .ok)
See HTTPClient.
Topics
Structures
struct BodyRepresents aResponse’s body.
Initializers
init(status: HTTPResponse.Status, headers: HTTPFields, body: Body, contentConfiguration: ContentConfiguration)Creates a newResponse.
Instance Properties
var body: BodyTheBody. Updating this property will also update the associated transport headers.var content: any ContentContainervar cookies: HTTPCookiesGet and setHTTPCookiesfor thisResponse. This accesses the"Set-Cookie"header.var description: Stringvar headers: HTTPFieldsThe header fields for this HTTP response. The"Content-Length"and"Transfer-Encoding"headers will be set automatically when thebodyproperty is mutated.var status: HTTPResponse.StatusThe HTTP response status.
Default Implementations
Relationships
Conforms To
ResponseEncodableSwift.CopyableSwift.CustomStringConvertibleSwift.EscapableSwift.SendableSwift.SendableMetatype