HTTPClient

public final class HTTPClient

HTTP Client class providing API for sending HTTP requests

  • Request structure to send

    Declaration

    Swift

    public struct Request
  • Response structure received back

    Declaration

    Swift

    public struct Response
  • Errors returned from HTTPClient when parsing responses

    See more

    Declaration

    Swift

    public enum HTTPError : Error
  • Specifies how EventLoopGroup will be created and establishes lifecycle ownership.

    See more

    Declaration

    Swift

    public enum EventLoopGroupProvider
  • Initialise HTTPClient

    Declaration

    Swift

    public init(eventLoopGroupProvider: EventLoopGroupProvider = .createNew)
  • send request to HTTP client, return a future holding the Response

    Declaration

    Swift

    public func connect(_ request: Request) -> EventLoopFuture<Response>
  • Shuts down the client and EventLoopGroup if it was created by the client.

    Declaration

    Swift

    public func syncShutdown() throws