Instance Methodasync-http-client 1.23.0AsyncHTTPClient
patch(url:body:deadline:)
Execute PATCH
request using specified URL.
func patch(url: String, body: Body? = nil, deadline: NIODeadline? = nil) -> EventLoopFuture<Response>
Parameters
Other members in extension
Types
struct Authorization
HTTP authentication.
struct Body
A request body.
struct Configuration
HTTPClient
configuration.struct Cookie
A representation of an HTTP cookie.
enum Decompression
Specifies decompression settings.
enum EventLoopGroupProvider
Specifies how
EventLoopGroup
will be created and establishes lifecycle ownership.struct EventLoopPreference
Specifies how the library will treat the event loop passed by the user.
struct Request
Represents an HTTP request.
struct Response
Represents an HTTP response.
class Task<Response>
Response execution context.
Type members
init(eventLoopGroup: EventLoopGroup, configuration: Configuration
) Create an
HTTPClient
with specifiedEventLoopGroup
and configuration.init(eventLoopGroup: any EventLoopGroup, configuration: Configuration, backgroundActivityLogger: Logger
) Create an
HTTPClient
with specifiedEventLoopGroup
and configuration.init(eventLoopGroupProvider: EventLoopGroupProvider, configuration: Configuration
) Create an
HTTPClient
with specifiedEventLoopGroup
provider and configuration.init(eventLoopGroupProvider: EventLoopGroupProvider, configuration: Configuration, backgroundActivityLogger: Logger
) Create an
HTTPClient
with specifiedEventLoopGroup
provider and configuration.static var defaultEventLoopGroup: EventLoopGroup
Returns the default
EventLoopGroup
singleton, automatically selecting the best for the platform.
Instance members
let eventLoopGroup: EventLoopGroup
The
EventLoopGroup
in use by thisHTTPClient
.func delete(url: String, deadline: NIODeadline?
) -> EventLoopFuture<Response> Execute
DELETE
request using specified URL.func delete(url: String, deadline: NIODeadline?, logger: Logger
) -> EventLoopFuture<Response> Execute
DELETE
request using specified URL.func execute(HTTPClientRequest, deadline: NIODeadline, logger: Logger?
) async throws -> HTTPClientResponse Execute arbitrary HTTP requests.
func execute(HTTPMethod, secureSocketPath: String, urlPath: String, body: Body?, deadline: NIODeadline?, logger: Logger?
) -> EventLoopFuture<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(HTTPMethod, socketPath: String, urlPath: String, body: Body?, deadline: NIODeadline?, logger: Logger?
) -> EventLoopFuture<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(HTTPClientRequest, timeout: TimeAmount, logger: Logger?
) async throws -> HTTPClientResponse Execute arbitrary HTTP requests.
func execute(HTTPMethod, url: String, body: Body?, deadline: NIODeadline?, logger: Logger?
) -> EventLoopFuture<Response> Execute arbitrary HTTP request using specified URL.
func execute(request: Request, deadline: NIODeadline?
) -> EventLoopFuture<Response> Execute arbitrary HTTP request using specified URL.
func execute(request: Request, deadline: NIODeadline?, logger: Logger
) -> EventLoopFuture<Response> Execute arbitrary HTTP request using specified URL.
func execute<Delegate>(request: Request, delegate: Delegate, deadline: NIODeadline?
) -> Task<Delegate.Response> Execute arbitrary HTTP request and handle response processing using provided delegate.
func execute<Delegate>(request: Request, delegate: Delegate, deadline: NIODeadline?, logger: Logger
) -> Task<Delegate.Response> Execute arbitrary HTTP request and handle response processing using provided delegate.
func execute<Delegate>(request: Request, delegate: Delegate, eventLoop: EventLoopPreference, deadline: NIODeadline?
) -> Task<Delegate.Response> Execute arbitrary HTTP request and handle response processing using provided delegate.
func execute<Delegate>(request: Request, delegate: Delegate, eventLoop: EventLoopPreference, deadline: NIODeadline?, logger: Logger?
) -> Task<Delegate.Response> Execute arbitrary HTTP request and handle response processing using provided delegate.
func execute(request: Request, eventLoop: EventLoopPreference, deadline: NIODeadline?
) -> EventLoopFuture<Response> Execute arbitrary HTTP request using specified URL.
func execute(request: Request, eventLoop: EventLoopPreference, deadline: NIODeadline?, logger: Logger?
) -> EventLoopFuture<Response> Execute arbitrary HTTP request and handle response processing using provided delegate.
func get(url: String, deadline: NIODeadline?
) -> EventLoopFuture<Response> Execute
GET
request using specified URL.func get(url: String, deadline: NIODeadline?, logger: Logger
) -> EventLoopFuture<Response> Execute
GET
request using specified URL.func patch(url: String, body: Body?, deadline: NIODeadline?, logger: Logger
) -> EventLoopFuture<Response> Execute
PATCH
request using specified URL.func post(url: String, body: Body?, deadline: NIODeadline?
) -> EventLoopFuture<Response> Execute
POST
request using specified URL.func post(url: String, body: Body?, deadline: NIODeadline?, logger: Logger
) -> EventLoopFuture<Response> Execute
POST
request using specified URL.func put(url: String, body: Body?, deadline: NIODeadline?
) -> EventLoopFuture<Response> Execute
PUT
request using specified URL.func put(url: String, body: Body?, deadline: NIODeadline?, logger: Logger
) -> EventLoopFuture<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.func shutdown(queue: DispatchQueue, @escaping (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.