eventLoopGroup
The EventLoopGroup in use by this HTTPClient.
let eventLoopGroup: any EventLoopGroupAll HTTP transactions will occur on loops owned by this group.
The EventLoopGroup in use by this HTTPClient.
let eventLoopGroup: any EventLoopGroups15AsyncHTTPClient0B0C14eventLoopGroup7NIOCore05EventdE0_pvp What are these?9IW7EAll HTTP transactions will occur on loops owned by this group.
import AsyncHTTPClientThis package provides simple HTTP Client library built on top of SwiftNIO.
final class HTTPClientHTTPClient class provides API for request execution.
convenience init(eventLoopGroup: any EventLoopGroup = HTTPClient.defaultEventLoopGroup, configuration: HTTPClient.Configuration = Configuration()) Create an HTTPClient with specified EventLoopGroup and configuration.
convenience init(eventLoopGroup: any EventLoopGroup = HTTPClient.defaultEventLoopGroup, configuration: HTTPClient.Configuration = Configuration(), backgroundActivityLogger: Logger) Create an HTTPClient with specified EventLoopGroup and configuration.
convenience init(eventLoopGroupProvider: HTTPClient.EventLoopGroupProvider, configuration: HTTPClient.Configuration = Configuration()) Create an HTTPClient with specified EventLoopGroup provider and configuration.
convenience init(eventLoopGroupProvider: HTTPClient.EventLoopGroupProvider, configuration: HTTPClient.Configuration = Configuration(), backgroundActivityLogger: Logger) Create an HTTPClient with specified EventLoopGroup provider and configuration.
static var defaultEventLoopGroup: any EventLoopGroup { get }Returns the default EventLoopGroup singleton, automatically selecting the best for the platform.
static var shared: HTTPClient { get }A globally shared, singleton HTTPClient.
static func withHTTPClient<Return>(eventLoopGroup: any EventLoopGroup = HTTPClient.defaultEventLoopGroup, configuration: HTTPClient.Configuration = Configuration(), backgroundActivityLogger: Logger? = nil, isolation: isolated (any Actor)? = #isolation, _ body: (HTTPClient) async throws -> Return) async throws -> Return Start & automatically shut down a new HTTPClient.
func delete(url: String, deadline: NIODeadline? = nil) -> EventLoopFuture<HTTPClient.Response> Execute DELETE request using specified URL.
func delete(url: String, deadline: NIODeadline? = nil, logger: Logger) -> EventLoopFuture<HTTPClient.Response> Execute DELETE request using specified URL.
func execute(_ request: HTTPClientRequest, deadline: NIODeadline, logger: Logger? = nil) async throws -> HTTPClientResponse Execute arbitrary HTTP requests.
func execute(_ method: HTTPMethod = .GET, secureSocketPath: String, urlPath: String, body: HTTPClient.Body? = nil, deadline: NIODeadline? = nil, logger: Logger? = nil) -> EventLoopFuture<HTTPClient.Response> Execute arbitrary HTTPS+UNIX request to a unix domain socket path over TLS, using the specified URL as the request to send to the server.
func execute(_ method: HTTPMethod = .GET, socketPath: String, urlPath: String, body: HTTPClient.Body? = nil, deadline: NIODeadline? = nil, logger: Logger? = nil) -> EventLoopFuture<HTTPClient.Response> Execute arbitrary HTTP+UNIX request to a unix domain socket path, using the specified URL as the request to send to the server.
func execute(_ request: HTTPClientRequest, timeout: TimeAmount, logger: Logger? = nil) async throws -> HTTPClientResponse Execute arbitrary HTTP requests.
func execute(_ method: HTTPMethod = .GET, url: String, body: HTTPClient.Body? = nil, deadline: NIODeadline? = nil, logger: Logger? = nil) -> EventLoopFuture<HTTPClient.Response> Execute arbitrary HTTP request using specified URL.
func execute(request: HTTPClient.Request, deadline: NIODeadline? = nil) -> EventLoopFuture<HTTPClient.Response> Execute arbitrary HTTP request using specified URL.
func execute(request: HTTPClient.Request, deadline: NIODeadline? = nil, logger: Logger) -> EventLoopFuture<HTTPClient.Response> Execute arbitrary HTTP request using specified URL.
func execute<Delegate>(request: HTTPClient.Request, delegate: Delegate, deadline: NIODeadline? = nil) -> HTTPClient.Task<Delegate.Response> where Delegate : HTTPClientResponseDelegate Execute arbitrary HTTP request and handle response processing using provided delegate.
func execute<Delegate>(request: HTTPClient.Request, delegate: Delegate, deadline: NIODeadline? = nil, logger: Logger) -> HTTPClient.Task<Delegate.Response> where Delegate : HTTPClientResponseDelegate Execute arbitrary HTTP request and handle response processing using provided delegate.
func execute<Delegate>(request: HTTPClient.Request, delegate: Delegate, eventLoop eventLoopPreference: HTTPClient.EventLoopPreference, deadline: NIODeadline? = nil) -> HTTPClient.Task<Delegate.Response> where Delegate : HTTPClientResponseDelegate Execute arbitrary HTTP request and handle response processing using provided delegate.
func execute<Delegate>(request: HTTPClient.Request, delegate: Delegate, eventLoop eventLoopPreference: HTTPClient.EventLoopPreference, deadline: NIODeadline? = nil, logger: Logger?) -> HTTPClient.Task<Delegate.Response> where Delegate : HTTPClientResponseDelegate Execute arbitrary HTTP request and handle response processing using provided delegate.
func execute(request: HTTPClient.Request, eventLoop: HTTPClient.EventLoopPreference, deadline: NIODeadline? = nil) -> EventLoopFuture<HTTPClient.Response> Execute arbitrary HTTP request using specified URL.
func execute(request: HTTPClient.Request, eventLoop eventLoopPreference: HTTPClient.EventLoopPreference, deadline: NIODeadline? = nil, logger: Logger?) -> EventLoopFuture<HTTPClient.Response> Execute arbitrary HTTP request and handle response processing using provided delegate.
func get(url: String, deadline: NIODeadline? = nil) -> EventLoopFuture<HTTPClient.Response> Execute GET request using specified URL.
func get(url: String, deadline: NIODeadline? = nil, logger: Logger) -> EventLoopFuture<HTTPClient.Response> Execute GET request using specified URL.
func patch(url: String, body: HTTPClient.Body? = nil, deadline: NIODeadline? = nil) -> EventLoopFuture<HTTPClient.Response> Execute PATCH request using specified URL.
func patch(url: String, body: HTTPClient.Body? = nil, deadline: NIODeadline? = nil, logger: Logger) -> EventLoopFuture<HTTPClient.Response> Execute PATCH request using specified URL.
func post(url: String, body: HTTPClient.Body? = nil, deadline: NIODeadline? = nil) -> EventLoopFuture<HTTPClient.Response> Execute POST request using specified URL.
func post(url: String, body: HTTPClient.Body? = nil, deadline: NIODeadline? = nil, logger: Logger) -> EventLoopFuture<HTTPClient.Response> Execute POST request using specified URL.
func put(url: String, body: HTTPClient.Body? = nil, deadline: NIODeadline? = nil) -> EventLoopFuture<HTTPClient.Response> Execute PUT request using specified URL.
func put(url: String, body: HTTPClient.Body? = nil, deadline: NIODeadline? = nil, logger: Logger) -> EventLoopFuture<HTTPClient.Response> Execute PUT request using specified URL.
func shutdown() -> EventLoopFuture<Void> Shuts down the HTTPClient and releases its resources.
func shutdown() async throws Shuts down the client and EventLoopGroup if it was created by the client.
@preconcurrency func shutdown(queue: DispatchQueue = .global(), _ callback: @escaping ((any Error)?) -> Void) Shuts down the client and event loop gracefully.
func syncShutdown() throws Shuts down the client and EventLoopGroup if it was created by the client.
struct AuthorizationHTTP authentication.
struct BodyA request body.
struct ConfigurationHTTPClient configuration.
struct CookieA representation of an HTTP cookie.
enum DecompressionSpecifies decompression settings.
enum EventLoopGroupProviderSpecifies how EventLoopGroup will be created and establishes lifecycle ownership.
struct EventLoopPreferenceSpecifies how the library will treat the event loop passed by the user.
struct RequestRepresents an HTTP request.
struct RequestResponsestruct ResponseRepresents an HTTP response.
final class Task<Response>Response execution context.