Protocols

The following protocols are available globally.

  • Protocol defining the contract for HTTP client implementations.

    The HttpClientProtocol provides a high-level interface for making HTTP requests with support for configuration, interceptors, and async/await patterns.

    See more

    Declaration

    Swift

    public protocol HttpClientProtocol : Sendable
  • Protocol defining the contract for building HTTP requests.

    HttpRequest provides a fluent interface for configuring HTTP requests including URL, headers, query parameters, cookies, and request body.

    This protocol requires Sendable conformance to allow passing request instances across async boundaries. However, implementations are not required to be thread-safe during configuration. Request builders are designed to be used within a single async context (typically a builder closure) and should not be shared or modified concurrently.

    See more

    Declaration

    Swift

    public protocol HttpRequest : AnyObject, Sendable
  • Protocol defining the contract for HTTP responses.

    HttpResponse provides access to the response status, headers, body, and cookies from an HTTP request.

    See more

    Declaration

    Swift

    public protocol HttpResponse : Sendable