HTTPResponder

public struct HTTPResponder : HBHTTPResponder

HTTP responder class for Hummingbird. This is the interface between Hummingbird and HummingbirdCore

The HummingbirdCore server calls respond to get the HTTP response from Hummingbird

  • Construct HTTP responder

    Declaration

    Swift

    public init(application: HBApplication)

    Parameters

    application

    application creating this responder

  • Logger used by responder

    Declaration

    Swift

    public var logger: Logger { get }
  • Return EventLoopFuture that will be fulfilled with the HTTP response for the supplied HTTP request

    Declaration

    Swift

    public func respond(to request: HBHTTPRequest, context: ChannelHandlerContext, onComplete: @escaping (Result<HBHTTPResponse, Error>) -> Void)

    Parameters

    request

    request

    context

    context from ChannelHandler

    Return Value

    response