Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.
Mattt edited this page May 1, 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.​Multipart​Encoding​Failure​Reason

The underlying reason the .multipartEncodingFailed error occurred.

AFError.​Parameter​Encoding​Failure​Reason

The underlying reason the .parameterEncodingFailed error occurred.

AFError.​Parameter​Encoder​Failure​Reason

The underlying reason the .parameterEncoderFailed error occurred.

AFError.​Parameter​Encoder​Failure​Reason.​Required​Component

Possible missing components.

AFError.​Response​Validation​Failure​Reason

The underlying reason the .responseValidationFailed error occurred.

AFError.​Response​Serialization​Failure​Reason

The underlying reason the response serialization error occurred.

AFError.​Server​Trust​Failure​Reason

Underlying reason a server trust evaluation error occurred.

AFError.​Server​Trust​Failure​Reason.​Output

The output of a server trust evaluation.

AFError.​URLRequest​Validation​Failure​Reason

The underlying reason the .urlRequestValidationFailed

AF

Global namespace containing API for the default Session instance.

Alamofire​Extension

Type that acts as a generic extension point for all AlamofireExtended types.

Response​Cacher

ResponseCacher is a convenience CachedResponseHandler making it easy to cache, not cache, or modify a cached response.

Response​Cacher.​Behavior

Defines the behavior of the ResponseCacher type.

Composite​Event​Monitor

An EventMonitor which can contain multiple EventMonitors and calls their methods on their queues.

Closure​Event​Monitor

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").

Multipart​Form​Data

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.

Network​Reachability​Manager

The NetworkReachabilityManager class listens for reachability changes of hosts and addresses for both cellular and WiFi network interfaces.

Network​Reachability​Manager.​Network​Reachability​Status

Defines the various states of network reachability.

Network​Reachability​Manager.​Network​Reachability​Status.​Connection​Type

Defines the various connection types detected by reachability flags.

Alamofire​Notifications

EventMonitor that provides Alamofire's notifications.

JSONParameter​Encoder

A ParameterEncoder that encodes types as JSON body data.

URLEncoded​Form​Parameter​Encoder

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.

URLEncoded​Form​Parameter​Encoder.​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.​Array​Encoding

Configures how Array parameters are encoded.

URLEncoding.​Bool​Encoding

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.

Data​Request

Request subclass which handles in-memory Data download using URLSessionDataTask.

Download​Request

Request subclass which downloads Data to a file on disk using URLSessionDownloadTask.

Download​Request.​Options

A set of options to be executed prior to moving a downloaded file from the temporary URL to the destination URL.

Download​Request.​Downloadable

Type describing the source used to create the underlying URLSessionDownloadTask.

Upload​Request

DataRequest subclass which handles Data upload from memory, file, or stream using URLSessionUploadTask.

Upload​Request.​Uploadable

Type describing the origin of the upload, whether Data, file, or stream.

Retry​Result

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.

Data​Response

Type used to store all values associated with a serialized response of a DataRequest or UploadRequest.

Download​Response

Used to store all data associated with a serialized response of a download request.

Passthrough​Preprocessor

DataPreprocessor that returns passed Data without any transform.

Google​XSSIPreprocessor

DataPreprocessor that trims Google's typical )]}',\n XSSI JSON header.

Data​Response​Serializer

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.

String​Response​Serializer

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.

JSONResponse​Serializer

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.

Decodable​Response​Serializer

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.

Retry​Policy

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.

Connection​Lost​Retry​Policy

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.

Server​Trust​Manager

Responsible for managing the mapping of ServerTrustEvaluating values to given hosts.

Default​Trust​Evaluator

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.

Revocation​Trust​Evaluator

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.

Revocation​Trust​Evaluator.​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.

Pinned​Certificates​Trust​Evaluator

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.

Public​Keys​Trust​Evaluator

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.

Composite​Trust​Evaluator

Uses the provided evaluators to validate the server trust. The trust is only considered valid if all of the evaluators consider it valid.

Disabled​Evaluator

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.

Session​Delegate

Class which implements the various URLSessionDelegate methods to connect various Alamofire features.

URLEncoded​Form​Encoder

An object that encodes instances into URL-encoded query strings.

URLEncoded​Form​Encoder.​Array​Encoding

Encoding to use for Array values.

URLEncoded​Form​Encoder.​Bool​Encoding

Encoding to use for Bool values.

URLEncoded​Form​Encoder.​Data​Encoding

Encoding to use for Data values.

URLEncoded​Form​Encoder.​Date​Encoding

Encoding to use for Date values.

URLEncoded​Form​Encoder.​Key​Encoding

Encoding to use for keys.

URLEncoded​Form​Encoder.​Space​Encoding

Encoding to use for spaces.

URLEncoded​Form​Encoder.​Error

URLEncodedFormEncoder error.

Protocols

Alamofire​Extended

Protocol describing the af extension points for Alamofire extended types.

Cached​Response​Handler

A type that handles whether the data task should store the HTTP response in the cache.

Event​Monitor

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.

Parameter​Encoder

A type that can encode any Encodable type into a URLRequest.

Parameter​Encoding

A type used to define how a set of parameters are applied to a URLRequest.

Redirect​Handler

A type that handles how an HTTP redirect response from a remote server should be redirected to the new request.

Request​Delegate

Protocol abstraction for Request's communication back to the SessionDelegate.

Uploadable​Convertible

A type that can produce an UploadRequest.Uploadable value.

Upload​Convertible

A type that can be converted to an upload, whether from an UploadRequest.Uploadable or URLRequestConvertible.

Request​Adapter

A type that can inspect and optionally adapt a URLRequest in some manner if necessary.

Request​Retrier

A type that determines whether a request should be retried after being executed by the specified session manager and encountering an error.

Request​Interceptor

Type that provides both RequestAdapter and RequestRetrier functionality.

Data​Response​Serializer​Protocol

The type to which all data response serializers must conform in order to serialize a response.

Download​Response​Serializer​Protocol

The type to which all download response serializers must conform in order to serialize a response.

Response​Serializer

A serializer that can handle both data and download responses.

Data​Preprocessor

Type used to preprocess Data before it handled by a serializer.

Empty​Response

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

Data​Decoder

Any type which can decode Data into a Decodable type.

Server​Trust​Evaluating

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.

URLRequest​Convertible

Types adopting the URLRequestConvertible protocol can be used to safely construct URLRequests.

Global Typealiases

Parameters

A dictionary of parameters to apply to a URLRequest.

Adapt​Handler

RequestAdapter closure definition.

Retry​Handler

RequestRetrier closure definition.

AFData​Response

Default type of DataResponse returned by Alamofire, with an AFError Failure type.

AFDownload​Response

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