Protocols

The following protocols are available globally.

Serialization

  • A type which can serialize incoming Data.

    See more

    Declaration

    Swift

    public protocol DataStreamSerializer : Sendable
  • A type that can encode any Encodable type into a URLRequest.

    See more

    Declaration

    Swift

    public protocol ParameterEncoder : Sendable
  • A type used to define how a set of parameters are applied to a URLRequest.

    See more

    Declaration

    Swift

    public protocol ParameterEncoding : Sendable

Protocol Conformances

  • Protocol abstraction for Request‘s communication back to the SessionDelegate.

    See more

    Declaration

    Swift

    public protocol RequestDelegate : AnyObject, Sendable
  • Types adopting the URLConvertible protocol can be used to construct URLs, which can then be used to construct URLRequests.

    See more

    Declaration

    Swift

    public protocol URLConvertible : Sendable
  • Types adopting the URLRequestConvertible protocol can be used to safely construct URLRequests.

    See more

    Declaration

    Swift

    public protocol URLRequestConvertible : Sendable
  • A type that can produce an UploadRequest.Uploadable value.

    See more

    Declaration

    Swift

    public protocol UploadableConvertible : Sendable
  • A type that can be converted to an upload, whether from an UploadRequest.Uploadable or URLRequestConvertible.

    Declaration

    Swift

    public protocol UploadConvertible : URLRequestConvertible, UploadableConvertible
  • Undocumented

    See more

    Declaration

    Swift

    public protocol WebSocketMessageSerializer<Output, Failure> : Sendable
  • Protocol describing the af extension points for Alamofire extended types.

    See more

    Declaration

    Swift

    public protocol AlamofireExtended
  • Types adopting the AuthenticationCredential protocol can be used to authenticate URLRequests.

    One common example of an AuthenticationCredential is an OAuth2 credential containing an access token used to authenticate all requests on behalf of a user. The access token generally has an expiration window of 60 minutes which will then require a refresh of the credential using the refresh token to generate a new access token.

    See more

    Declaration

    Swift

    public protocol AuthenticationCredential
  • Types adopting the Authenticator protocol can be used to authenticate URLRequests with an AuthenticationCredential as well as refresh the AuthenticationCredential when required.

    See more

    Declaration

    Swift

    public protocol Authenticator : AnyObject, Sendable
  • A type that handles whether the data task should store the HTTP response in the cache.

    See more

    Declaration

    Swift

    public protocol CachedResponseHandler : Sendable
  • Protocol outlining the lifetime events inside Alamofire. It includes both events received from the various URLSession delegate protocols as well as various events from the lifetime of Request and its subclasses.

    See more

    Declaration

    Swift

    public protocol EventMonitor : Sendable
  • A type that handles how an HTTP redirect response from a remote server should be redirected to the new request.

    See more

    Declaration

    Swift

    public protocol RedirectHandler : Sendable
  • Type that provides both RequestAdapter and RequestRetrier functionality.

    See more

    Declaration

    Swift

    public protocol RequestInterceptor : RequestAdapter, RequestRetrier
  • A type that can inspect and optionally adapt a URLRequest in some manner if necessary.

    See more

    Declaration

    Swift

    public protocol RequestAdapter : Sendable
  • A type that determines whether a request should be retried after being executed by the specified session manager and encountering an error.

    See more

    Declaration

    Swift

    public protocol RequestRetrier : Sendable
  • The type to which all data response serializers must conform in order to serialize a response.

    See more

    Declaration

    Swift

    public protocol DataResponseSerializerProtocol<SerializedObject> : Sendable
  • The type to which all download response serializers must conform in order to serialize a response.

    See more

    Declaration

    Swift

    public protocol DownloadResponseSerializerProtocol<SerializedObject> : Sendable
  • A serializer that can handle both data and download responses.

    See more

    Declaration

    Swift

    public protocol ResponseSerializer<SerializedObject> : DataResponseSerializerProtocol, DownloadResponseSerializerProtocol
  • Type used to preprocess Data before it handled by a serializer.

    See more

    Declaration

    Swift

    public protocol DataPreprocessor : Sendable

Empty

  • Protocol representing an empty response. Use T.emptyValue() to get an instance.

    See more

    Declaration

    Swift

    public protocol EmptyResponse : Sendable

DataDecoder Protocol

  • Any type which can decode Data into a Decodable type.

    See more

    Declaration

    Swift

    public protocol DataDecoder : Sendable
  • A protocol describing the API used to evaluate server trusts.

    See more

    Declaration

    Swift

    public protocol ServerTrustEvaluating : Sendable