HBResponse

public struct HBResponse : HBExtensible
extension HBResponse: HBResponseGenerator

Holds all the required to generate a HTTP Response

  • response status

    Declaration

    Swift

    public var status: HTTPResponseStatus
  • response headers

    Declaration

    Swift

    public var headers: HTTPHeaders
  • response body

    Declaration

    Swift

    public var body: HBResponseBody
  • Response extensions

    Declaration

    Swift

    public var extensions: HBExtensions<HBResponse>
  • Create an HBResponse

    Declaration

    Swift

    public init(status: HTTPResponseStatus, headers: HTTPHeaders = [:], body: HBResponseBody = .empty)

    Parameters

    status

    response status

    headers

    response headers

    body

    response body

  • Return self as the response

    Declaration

    Swift

    public func response(from request: HBRequest) -> HBResponse
  • apply HBRequest.ResponsePatch to HBResponse

    Declaration

    Swift

    mutating func apply(patch: HBRequest.ResponsePatch?) -> HBResponse