docs/Structs.html
The following structures are available globally.
`
DecodableStreamSerializer
`
DataStreamSerializer which uses the provided DataPreprocessor and DataDecoder to serialize the incoming Data.
Swift
public struct DecodableStreamSerializer<T> : DataStreamSerializer where T : Decodable, T : Sendable
`
PassthroughStreamSerializer
`
DataStreamSerializer which performs no serialization on incoming Data.
Swift
public struct PassthroughStreamSerializer : DataStreamSerializer
`
StringStreamSerializer
`
DataStreamSerializer which serializes incoming stream Data into UTF8-decoded String values.
Swift
public struct StringStreamSerializer : DataStreamSerializer
`
HTTPHeaders
`
An order-preserving and case-insensitive representation of HTTP headers.
Swift
public struct HTTPHeaders : Equatable, Hashable, Sendable
extension HTTPHeaders: ExpressibleByDictionaryLiteral
extension HTTPHeaders: ExpressibleByArrayLiteral
extension HTTPHeaders: Sequence
extension HTTPHeaders: Collection
extension HTTPHeaders: CustomStringConvertible
`
HTTPHeader
`
A representation of a single HTTP header’s name / value pair.
Swift
public struct HTTPHeader : Equatable, Hashable, Sendable
extension HTTPHeader: CustomStringConvertible
`
HTTPMethod
`
Type representing HTTP methods. Raw String value is stored and compared case-sensitively, so HTTPMethod.get != HTTPMethod(rawValue: "get").
See https://tools.ietf.org/html/rfc7231#section-4.3
Swift
public struct HTTPMethod : RawRepresentable, Equatable, Hashable, Sendable
`
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.
The Content-Type HTTP header field of an encoded request with HTTP body is set to application/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.
BoolEncoding can be used to configure how boolean values are encoded. The default behavior is to encode true as 1 and false as 0.
Swift
public struct URLEncoding : ParameterEncoding
`
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.
Swift
public struct JSONEncoding : ParameterEncoding
`
DataResponse
`
Type used to store all values associated with a serialized response of a DataRequest or UploadRequest.
Swift
public struct DataResponse<Success, Failure> : Sendable where Success : Sendable, Failure : Error
extension DataResponse: CustomStringConvertible, CustomDebugStringConvertible
`
DownloadResponse
`
Used to store all data associated with a serialized response of a download request.
Swift
public struct DownloadResponse<Success, Failure> : Sendable where Success : Sendable, Failure : Error
extension DownloadResponse: CustomStringConvertible, CustomDebugStringConvertible
`
DecodableWebSocketMessageDecoder
`
Undocumented
Swift
public struct DecodableWebSocketMessageDecoder<Value> : WebSocketMessageSerializer where Value : Decodable, Value : Sendable
`
AlamofireExtension
`
Type that acts as a generic extension point for all AlamofireExtended types.
Swift
public struct AlamofireExtension<ExtendedType>
`
ResponseCacher
`
ResponseCacher is a convenience CachedResponseHandler making it easy to cache, not cache, or modify a cached response.
Swift
public struct ResponseCacher
extension ResponseCacher: CachedResponseHandler
`
DataResponsePublisher
`
A Combine Publisher that publishes the DataResponse<Value, AFError> of the provided DataRequest.
Swift
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
public struct DataResponsePublisher<Value> : Publisher where Value : Sendable
`
DataStreamPublisher
`
Undocumented
Swift
public struct DataStreamPublisher<Value> : Publisher where Value : Sendable
`
DownloadResponsePublisher
`
A Combine Publisher that publishes the DownloadResponse<Value, AFError> of the provided DownloadRequest.
Swift
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
public struct DownloadResponsePublisher<Value> : Publisher where Value : Sendable
`
DataTask
`
Value used to await a DataResponse and associated values.
Swift
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public struct DataTask<Value> : Sendable where Value : Sendable
`
DownloadTask
`
Value used to await a DownloadResponse and associated values.
Swift
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public struct DownloadTask<Value> : Sendable where Value : Sendable
`
DataStreamTask
`
Undocumented
Swift
public struct DataStreamTask : Sendable
`
StreamOf
`
An asynchronous sequence generated from an underlying AsyncStream. Only produced by Alamofire.
Note
Like AsyncStream, StreamOf does not support multiple iteration. Multiple iteration may lead to lost values or other misbehavior.
See more
Swift
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public struct StreamOf<Element> : AsyncSequence
`
Redirector
`
Redirector is a convenience RedirectHandler making it easy to follow, not follow, or modify a redirect.
Swift
public struct Redirector
extension Redirector: RedirectHandler
`
DeflateRequestCompressor
`
RequestAdapter which compresses outgoing URLRequest bodies using the deflate 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 dedicated requestQueue in your Session instance. Finally, not all servers support request compression, so test with all of your server configurations before deploying.
See more
Swift
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public struct DeflateRequestCompressor : Sendable, RequestInterceptor
`
RequestAdapterState
`
Stores all state associated with a URLRequest being adapted.
Swift
public struct RequestAdapterState : Sendable
`
PassthroughPreprocessor
`
DataPreprocessor that returns passed Data without any transform.
Swift
public struct PassthroughPreprocessor : DataPreprocessor
`
GoogleXSSIPreprocessor
`
DataPreprocessor that trims Google’s typical )]}',\n XSSI JSON header.
Swift
public struct GoogleXSSIPreprocessor : DataPreprocessor
`
URLResponseSerializer
`
A DownloadResponseSerializerProtocol that performs only Error checking and ensures that a downloaded fileURL is present.
Swift
public struct URLResponseSerializer : DownloadResponseSerializerProtocol
`
Empty
`
Type representing an empty value. Use Empty.value to get the static instance.
Swift
public struct Empty : Hashable, Codable, Sendable
extension Empty: EmptyResponse