The following protocols are available globally.

  • HTTPClientResponseDelegate allows an implementation to receive notifications about request processing and to control how response parts are processed. You can implement this protocol if you need fine-grained control over an HTTP request/response, for example, if you want to inspect the response headers before deciding whether to accept a response body, or if you want to stream your request body. Pass an instance of your conforming class to the HTTPClient.execute() method and this package will call each delegate method appropriately as the request takes place.


    This delegate is strongly held by the HTTPTaskHandler for the duration of the Request processing and will be released together with the HTTPTaskHandler when channel is closed. Users of the library are not required to keep a reference to the object that implements this protocol, but may do so if needed.
    See more



    public protocol HTTPClientResponseDelegate : AnyObject