didSendRequest(task:)
Called when the request is fully sent. Will be called once.
func didSendRequest(task: HTTPClient.Task<Response>)
Parameters
- task
Current request context.
Called when the request is fully sent. Will be called once.
func didSendRequest(task: HTTPClient.Task<Response>)
s15AsyncHTTPClient0B16ResponseDelegateP14didSendRequest4taskyAA0B0C4TaskCy_0C0QzG_tF
What are these?9OD5P
Current request context.
import AsyncHTTPClient
This package provides simple HTTP Client library built on top of SwiftNIO.
protocol HTTPClientResponseDelegate : AnyObject
HTTPClientResponseDelegate
allows an implementation to receive notifications about request processing and to control how response parts are processed.
class HTTPClient
HTTPClient class provides API for request execution.
final class Task<Response>
Response execution context.
associatedtype Response
func didFinishRequest(task: HTTPClient.Task<Response>) throws -> Response
Called when the complete HTTP request is finished. You must return an instance of your Response
associated type. Will be called once, except if an error occurred.
func didReceiveBodyPart(task: HTTPClient.Task<Response>, _ buffer: ByteBuffer) -> EventLoopFuture<Void>
Called when part of a response body is received. Could be called zero or more times. You must return an EventLoopFuture<Void>
that you complete when you have finished processing the body part. You can create an already succeeded future by calling task.eventLoop.makeSucceededFuture(())
.
func didReceiveError(task: HTTPClient.Task<Response>, _ error: Error)
Called when error was thrown during request execution. Will be called zero or one time only. Request processing will be stopped after that.
func didReceiveHead(task: HTTPClient.Task<Response>, _ head: HTTPResponseHead) -> EventLoopFuture<Void>
Called when response head is received. Will be called once. You must return an EventLoopFuture<Void>
that you complete when you have finished processing the body part. You can create an already succeeded future by calling task.eventLoop.makeSucceededFuture(())
.
func didSendRequestHead(task: HTTPClient.Task<Response>, _ head: HTTPRequestHead)
Called when the request head is sent. Will be called once.
func didSendRequestPart(task: HTTPClient.Task<Response>, _ part: IOData)
Called when a part of the request body is sent. Could be called zero or more times.
func didSendRequest(task: HTTPClient.Task<Response>)
Default implementation of didSendRequest(task:)
.