Structures
The following structures are available globally.
-
See moreDataStreamSerializer
which uses the providedDataPreprocessor
andDataDecoder
to serialize the incomingData
.Declaration
Swift
public struct DecodableStreamSerializer<T> : DataStreamSerializer where T : Decodable, T : Sendable
-
See moreDataStreamSerializer
which performs no serialization on incomingData
.Declaration
Swift
public struct PassthroughStreamSerializer : DataStreamSerializer
-
See moreDataStreamSerializer
which serializes incoming streamData
intoUTF8
-decodedString
values.Declaration
Swift
public struct StringStreamSerializer : DataStreamSerializer
-
An order-preserving and case-insensitive representation of HTTP headers.
See moreDeclaration
Swift
public struct HTTPHeaders : Equatable, Hashable, Sendable
extension HTTPHeaders: ExpressibleByDictionaryLiteral
extension HTTPHeaders: ExpressibleByArrayLiteral
extension HTTPHeaders: Sequence
extension HTTPHeaders: Collection
extension HTTPHeaders: CustomStringConvertible
-
A representation of a single HTTP header’s name / value pair.
See moreDeclaration
Swift
public struct HTTPHeader : Equatable, Hashable, Sendable
extension HTTPHeader: CustomStringConvertible
-
Type representing HTTP methods. Raw
String
value is stored and compared case-sensitively, soHTTPMethod.get != HTTPMethod(rawValue: "get")
.See https://tools.ietf.org/html/rfc7231#section-4.3
See moreDeclaration
Swift
public struct HTTPMethod : RawRepresentable, Equatable, Hashable, Sendable
-
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.
The
Content-Type
HTTP header field of an encoded request with HTTP body is set toapplication/x-www-form-urlencoded; charset=utf-8
.There is no published specification for how to encode collection types. By default the convention of appending
[]
to the key for array values (foo[]=1&foo[]=2
), and appending the key surrounded by square brackets for nested dictionary values (foo[bar]=baz
) is used. Optionally,ArrayEncoding
can be used to omit the square brackets appended to array keys.
See moreBoolEncoding
can be used to configure how boolean values are encoded. The default behavior is to encodetrue
as 1 andfalse
as 0.Declaration
Swift
public struct URLEncoding : ParameterEncoding
-
Uses
See moreJSONSerialization
to create a JSON representation of the parameters object, which is set as the body of the request. TheContent-Type
HTTP header field of an encoded request is set toapplication/json
.Declaration
Swift
public struct JSONEncoding : ParameterEncoding
-
Type used to store all values associated with a serialized response of a
See moreDataRequest
orUploadRequest
.Declaration
Swift
public struct DataResponse<Success, Failure> : Sendable where Success : Sendable, Failure : Error
extension DataResponse: CustomStringConvertible, CustomDebugStringConvertible
-
Used to store all data associated with a serialized response of a download request.
See moreDeclaration
Swift
public struct DownloadResponse<Success, Failure> : Sendable where Success : Sendable, Failure : Error
extension DownloadResponse: CustomStringConvertible, CustomDebugStringConvertible
-
Undocumented
See moreDeclaration
Swift
public struct DecodableWebSocketMessageDecoder<Value> : WebSocketMessageSerializer where Value : Decodable, Value : Sendable
-
Type that acts as a generic extension point for all
See moreAlamofireExtended
types.Declaration
Swift
public struct AlamofireExtension<ExtendedType>
-
See moreResponseCacher
is a convenienceCachedResponseHandler
making it easy to cache, not cache, or modify a cached response.Declaration
-
A Combine
See morePublisher
that publishes theDataResponse<Value, AFError>
of the providedDataRequest
.Declaration
Swift
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *) public struct DataResponsePublisher<Value> : Publisher where Value : Sendable
-
Undocumented
See moreDeclaration
Swift
public struct DataStreamPublisher<Value> : Publisher where Value : Sendable
-
A Combine
See morePublisher
that publishes theDownloadResponse<Value, AFError>
of the providedDownloadRequest
.Declaration
Swift
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *) public struct DownloadResponsePublisher<Value> : Publisher where Value : Sendable
-
Value used to
See moreawait
aDataResponse
and associated values.Declaration
Swift
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) public struct DataTask<Value> : Sendable where Value : Sendable
-
Value used to
See moreawait
aDownloadResponse
and associated values.Declaration
Swift
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) public struct DownloadTask<Value> : Sendable where Value : Sendable
-
Undocumented
See moreDeclaration
Swift
public struct DataStreamTask : Sendable
-
An asynchronous sequence generated from an underlying
See moreAsyncStream
. Only produced by Alamofire.Declaration
Swift
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) public struct StreamOf<Element> : AsyncSequence
-
See moreRedirector
is a convenienceRedirectHandler
making it easy to follow, not follow, or modify a redirect.Declaration
-
RequestAdapter
which compresses outgoingURLRequest
bodies using thedeflate
Content-Encoding
and adds the appropriate header.Note
Most requests to most APIs are small and so would only be slowed down by applying this adapter. Measure the size of your request bodies and the performance impact of using this adapter before use. Using this adapter with already compressed data, such as images, will, at best, have no effect. Additionally, body compression is a synchronous operation, so measuring the performance impact may be important to determine whether you want to use a dedicatedrequestQueue
in yourSession
instance. Finally, not all servers support request compression, so test with all of your server configurations before deploying.Declaration
Swift
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) public struct DeflateRequestCompressor : Sendable, RequestInterceptor
-
Stores all state associated with a
See moreURLRequest
being adapted.Declaration
Swift
public struct RequestAdapterState : Sendable
-
See moreDataPreprocessor
that returns passedData
without any transform.Declaration
Swift
public struct PassthroughPreprocessor : DataPreprocessor
-
See moreDataPreprocessor
that trims Google’s typical)]}',\n
XSSI JSON header.Declaration
Swift
public struct GoogleXSSIPreprocessor : DataPreprocessor
-
A
See moreDownloadResponseSerializerProtocol
that performs onlyError
checking and ensures that a downloadedfileURL
is present.Declaration
Swift
public struct URLResponseSerializer : DownloadResponseSerializerProtocol
-
Type representing an empty value. Use
See moreEmpty.value
to get the static instance.Declaration