Protocols
The following protocols are available globally.
-
Protocol defining the contract for HTTP client implementations.
The
See moreHttpClientProtocolprovides a high-level interface for making HTTP requests with support for configuration, interceptors, and async/await patterns.Declaration
Swift
public protocol HttpClientProtocol : Sendable -
Protocol defining the contract for building HTTP requests.
HttpRequestprovides a fluent interface for configuring HTTP requests including URL, headers, query parameters, cookies, and request body.This protocol requires
Sendableconformance 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 moreDeclaration
Swift
public protocol HttpRequest : AnyObject, Sendable -
Protocol defining the contract for HTTP responses.
See moreHttpResponseprovides access to the response status, headers, body, and cookies from an HTTP request.Declaration
Swift
public protocol HttpResponse : Sendable
View on GitHub
Protocols Reference