Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.
mattt edited this page Sep 18, 2020 · 9 revisions

Types

  • AFError:​ AFError is the error type returned by Alamofire. It encompasses a few different types of errors, each with their own associated reasons.
  • AFError.MultipartEncodingFailureReason:​ The underlying reason the .multipartEncodingFailed error occurred.
  • AFError.ParameterEncodingFailureReason:​ The underlying reason the .parameterEncodingFailed error occurred.
  • AFError.ParameterEncoderFailureReason:​ The underlying reason the .parameterEncoderFailed error occurred.
  • AFError.ParameterEncoderFailureReason.RequiredComponent:​ Possible missing components.
  • AFError.ResponseValidationFailureReason:​ The underlying reason the .responseValidationFailed error occurred.
  • AFError.ResponseSerializationFailureReason:​ The underlying reason the response serialization error occurred.
  • AFError.ServerTrustFailureReason:​ Underlying reason a server trust evaluation error occurred.
  • AFError.ServerTrustFailureReason.Output:​ The output of a server trust evaluation.
  • AFError.URLRequestValidationFailureReason:​ The underlying reason the .urlRequestValidationFailed
  • AF:​ Global namespace containing API for the default Session instance.
  • AlamofireExtension:​ Type that acts as a generic extension point for all AlamofireExtended types.
  • ResponseCacher:​ ResponseCacher is a convenience CachedResponseHandler making it easy to cache, not cache, or modify a cached response.
  • ResponseCacher.Behavior:​ Defines the behavior of the ResponseCacher type.
  • CompositeEventMonitor:​ An EventMonitor which can contain multiple EventMonitors and calls their methods on their queues.
  • ClosureEventMonitor:​ EventMonitor that allows optional closures to be set to receive events.
  • HTTPHeaders:​ An order-preserving and case-insensitive representation of HTTP headers.
  • HTTPHeader:​ A representation of a single HTTP header's name / value pair.
  • HTTPMethod:​ Type representing HTTP methods. Raw String value is stored and compared case-sensitively, so HTTPMethod.get != HTTPMethod(rawValue:​ "get").
  • MultipartFormData:​ Constructs multipart/form-data for uploads within an HTTP or HTTPS body. There are currently two ways to encode multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset.
  • NetworkReachabilityManager:​ The NetworkReachabilityManager class listens for reachability changes of hosts and addresses for both cellular and WiFi network interfaces.
  • NetworkReachabilityManager.NetworkReachabilityStatus:​ Defines the various states of network reachability.
  • NetworkReachabilityManager.NetworkReachabilityStatus.ConnectionType:​ Defines the various connection types detected by reachability flags.
  • AlamofireNotifications:​ EventMonitor that provides Alamofire's notifications.
  • JSONParameterEncoder:​ A ParameterEncoder that encodes types as JSON body data.
  • URLEncodedFormParameterEncoder:​ A ParameterEncoder that encodes types as URL-encoded query strings to be set on the URL or as body data, depending on the Destination set.
  • URLEncodedFormParameterEncoder.Destination:​ Defines where the URL-encoded string should be set for each URLRequest.
  • URLEncoding:​ Creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP body of the URL request. Whether the query string is set or appended to any existing URL query string or set as the HTTP body depends on the destination of the encoding.
  • URLEncoding.Destination:​ Defines whether the url-encoded query string is applied to the existing query string or HTTP body of the resulting URL request.
  • URLEncoding.ArrayEncoding:​ Configures how Array parameters are encoded.
  • URLEncoding.BoolEncoding:​ Configures how Bool parameters are encoded.
  • JSONEncoding:​ Uses JSONSerialization to create a JSON representation of the parameters object, which is set as the body of the request. The Content-Type HTTP header field of an encoded request is set to application/json.
  • Redirector:​ Redirector is a convenience RedirectHandler making it easy to follow, not follow, or modify a redirect.
  • Redirector.Behavior:​ Defines the behavior of the Redirector type.
  • Request:​ Request is the common superclass of all Alamofire request types and provides common state, delegate, and callback handling.
  • Request.State:​ State of the Request, with managed transitions between states set when calling resume(), suspend(), or cancel() on the Request.
  • DataRequest:​ Request subclass which handles in-memory Data download using URLSessionDataTask.
  • DownloadRequest:​ Request subclass which downloads Data to a file on disk using URLSessionDownloadTask.
  • DownloadRequest.Options:​ A set of options to be executed prior to moving a downloaded file from the temporary URL to the destination URL.
  • DownloadRequest.Downloadable:​ Type describing the source used to create the underlying URLSessionDownloadTask.
  • UploadRequest:​ DataRequest subclass which handles Data upload from memory, file, or stream using URLSessionUploadTask.
  • UploadRequest.Uploadable:​ Type describing the origin of the upload, whether Data, file, or stream.
  • RetryResult:​ Outcome of determination whether retry is necessary.
  • Adapter:​ Closure-based RequestAdapter.
  • Retrier:​ Closure-based RequestRetrier.
  • Interceptor:​ RequestInterceptor which can use multiple RequestAdapter and RequestRetrier values.
  • DataResponse:​ Type used to store all values associated with a serialized response of a DataRequest or UploadRequest.
  • DownloadResponse:​ Used to store all data associated with a serialized response of a download request.
  • PassthroughPreprocessor:​ DataPreprocessor that returns passed Data without any transform.
  • GoogleXSSIPreprocessor:​ DataPreprocessor that trims Google's typical )]}',\n XSSI JSON header.
  • DataResponseSerializer:​ A ResponseSerializer that performs minimal response checking and returns any response data as-is. By default, a request returning nil or no data is considered an error. However, if the response is has a status code valid for empty responses (204, 205), then an empty Data value is returned.
  • StringResponseSerializer:​ A ResponseSerializer that decodes the response data as a String. By default, a request returning nil or no data is considered an error. However, if the response is has a status code valid for empty responses (204, 205), then an empty String is returned.
  • JSONResponseSerializer:​ A ResponseSerializer that decodes the response data using JSONSerialization. By default, a request returning nil or no data is considered an error. However, if the response is has a status code valid for empty responses (204, 205), then an NSNull value is returned.
  • Empty:​ Type representing an empty response. Use Empty.value to get the static instance.
  • DecodableResponseSerializer:​ A ResponseSerializer that decodes the response data as a generic value using any type that conforms to DataDecoder. By default, this is an instance of JSONDecoder. Additionally, a request returning nil or no data is considered an error. However, if the response is has a status code valid for empty responses (204, 205), then the Empty.value value is returned.
  • RetryPolicy:​ A retry policy that retries requests using an exponential backoff for allowed HTTP methods and HTTP status codes as well as certain types of networking errors.
  • ConnectionLostRetryPolicy:​ A retry policy that automatically retries idempotent requests for network connection lost errors. For more information about retrying network connection lost errors, please refer to Apple's technical document.
  • ServerTrustManager:​ Responsible for managing the mapping of ServerTrustEvaluating values to given hosts.
  • DefaultTrustEvaluator:​ An evaluator which uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge. Applications are encouraged to always validate the host in production environments to guarantee the validity of the server's certificate chain.
  • RevocationTrustEvaluator:​ An evaluator which Uses the default and revoked server trust evaluations allowing you to control whether to validate the host provided by the challenge as well as specify the revocation flags for testing for revoked certificates. Apple platforms did not start testing for revoked certificates automatically until iOS 10.1, macOS 10.12 and tvOS 10.1 which is demonstrated in our TLS tests. Applications are encouraged to always validate the host in production environments to guarantee the validity of the server's certificate chain.
  • RevocationTrustEvaluator.Options:​ Represents the options to be use when evaluating the status of a certificate. Only Revocation Policy Constants are valid, and can be found in Apple's documentation.
  • PinnedCertificatesTrustEvaluator:​ Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates. By validating both the certificate chain and host, certificate pinning provides a very secure form of server trust validation mitigating most, if not all, MITM attacks. Applications are encouraged to always validate the host and require a valid certificate chain in production environments.
  • PublicKeysTrustEvaluator:​ Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys. By validating both the certificate chain and host, public key pinning provides a very secure form of server trust validation mitigating most, if not all, MITM attacks. Applications are encouraged to always validate the host and require a valid certificate chain in production environments.
  • CompositeTrustEvaluator:​ Uses the provided evaluators to validate the server trust. The trust is only considered valid if all of the evaluators consider it valid.
  • DisabledEvaluator:​ Disables all evaluation which in turn will always consider any server trust as valid.
  • Session:​ Session creates and manages Alamofire's Request types during their lifetimes. It also provides common functionality for all Requests, including queuing, interception, trust management, redirect handling, and response cache handling.
  • SessionDelegate:​ Class which implements the various URLSessionDelegate methods to connect various Alamofire features.
  • URLEncodedFormEncoder:​ An object that encodes instances into URL-encoded query strings.
  • URLEncodedFormEncoder.ArrayEncoding:​ Encoding to use for Array values.
  • URLEncodedFormEncoder.BoolEncoding:​ Encoding to use for Bool values.
  • URLEncodedFormEncoder.DataEncoding:​ Encoding to use for Data values.
  • URLEncodedFormEncoder.DateEncoding:​ Encoding to use for Date values.
  • URLEncodedFormEncoder.KeyEncoding:​ Encoding to use for keys.
  • URLEncodedFormEncoder.SpaceEncoding:​ Encoding to use for spaces.
  • URLEncodedFormEncoder.Error:​ URLEncodedFormEncoder error.

Protocols

  • AlamofireExtended:​ Protocol describing the af extension points for Alamofire extended types.
  • CachedResponseHandler:​ A type that handles whether the data task should store the HTTP response in the cache.
  • EventMonitor:​ 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.
  • ParameterEncoder:​ A type that can encode any Encodable type into a URLRequest.
  • ParameterEncoding:​ A type used to define how a set of parameters are applied to a URLRequest.
  • RedirectHandler:​ A type that handles how an HTTP redirect response from a remote server should be redirected to the new request.
  • RequestDelegate:​ Protocol abstraction for Request's communication back to the SessionDelegate.
  • UploadableConvertible:​ A type that can produce an UploadRequest.Uploadable value.
  • UploadConvertible:​ A type that can be converted to an upload, whether from an UploadRequest.Uploadable or URLRequestConvertible.
  • RequestAdapter:​ A type that can inspect and optionally adapt a URLRequest in some manner if necessary.
  • RequestRetrier:​ A type that determines whether a request should be retried after being executed by the specified session manager and encountering an error.
  • RequestInterceptor:​ Type that provides both RequestAdapter and RequestRetrier functionality.
  • DataResponseSerializerProtocol:​ The type to which all data response serializers must conform in order to serialize a response.
  • DownloadResponseSerializerProtocol:​ The type to which all download response serializers must conform in order to serialize a response.
  • ResponseSerializer:​ A serializer that can handle both data and download responses.
  • DataPreprocessor:​ Type used to preprocess Data before it handled by a serializer.
  • EmptyResponse:​ Protocol representing an empty response. Use T.emptyValue() to get an instance.
  • DataDecoder:​ Any type which can decode Data into a Decodable type.
  • ServerTrustEvaluating:​ A protocol describing the API used to evaluate server trusts.
  • URLConvertible:​ Types adopting the URLConvertible protocol can be used to construct URLs, which can then be used to construct URLRequests.
  • URLRequestConvertible:​ Types adopting the URLRequestConvertible protocol can be used to safely construct URLRequests.

Global Typealiases

  • Parameters:​ A dictionary of parameters to apply to a URLRequest.
  • AdaptHandler:​ RequestAdapter closure definition.
  • RetryHandler:​ RequestRetrier closure definition.
  • AFDataResponse:​ Default type of DataResponse returned by Alamofire, with an AFError Failure type.
  • AFDownloadResponse:​ Default type of DownloadResponse returned by Alamofire, with an AFError Failure type.
  • AFResult:​ Default type of Result returned by Alamofire, with an AFError Failure type.
Types
Protocols
Global Typealiases
Clone this wiki locally