Structurehummingbird 2.1.0HummingbirdCore
Response
Holds all the required to generate a HTTP Response
Response.swift:18struct Response
Citizens in HummingbirdCore
Conformances
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Escapable
protocol Sendable
Type members
init(status: HTTPResponse.Status, headers: HTTPFields, body: ResponseBody
) Initialize Response
Instance members
var body: ResponseBody
Response body
var description: String
var head: HTTPResponse
Response head constructed from status and headers
var headers: HTTPFields
Response headers
var status: HTTPResponse.Status
Response status
func createHeadResponse(
) -> Response Return HEAD response based off this response
Available in Hummingbird
Conformances
protocol ResponseGenerator
Object that can generate a
Response
.
Types
enum RedirectType
Specifies the type of redirect that the client should receive.
Type members
static func redirect(to: String, type: RedirectType
) -> Response Create a redirect response
Instance members
func response(from: Request, context: some RequestContext
) -> Response Return self as the response
func setCookie(Cookie
) Set cookie on response