Structures

The following structures are available globally.

DataRequest / UploadRequest

  • A Combine Publisher that publishes the DataResponse<Value, AFError> of the provided DataRequest.

    See more

    Declaration

    Swift

    @available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
    public struct DataResponsePublisher<Value> : Publisher
  • Undocumented

    See more

    Declaration

    Swift

    public struct DataStreamPublisher<Value> : Publisher
  • A Combine Publisher that publishes the DownloadResponse<Value, AFError> of the provided DownloadRequest.

    See more

    Declaration

    Swift

    @available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
    public struct DownloadResponsePublisher<Value> : Publisher

DataTask

  • Value used to await a DataResponse and associated values.

    See more

    Declaration

    Swift

    @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
    public struct DataTask<Value>

DownloadTask

  • Value used to await a DownloadResponse and associated values.

    See more

    Declaration

    Swift

    @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
    public struct DownloadTask<Value>

DataStreamTask

  • Undocumented

    See more

    Declaration

    Swift

    public struct DataStreamTask
  • An asynchronous sequence generated from an underlying AsyncStream. Only produced by Alamofire.

    See more

    Declaration

    Swift

    @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
    public struct StreamOf<Element> : AsyncSequence
  • An order-preserving and case-insensitive representation of HTTP headers.

    See more

    Declaration

    Swift

    public struct HTTPHeaders
    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.

    See more

    Declaration

    Swift

    public struct HTTPHeader : Hashable
    extension HTTPHeader: CustomStringConvertible
  • 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

    See more

    Declaration

    Swift

    public struct HTTPMethod : RawRepresentable, Equatable, Hashable
  • 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.

    See more

    Declaration

    Swift

    public struct URLEncoding : ParameterEncoding
  • 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.

    See more

    Declaration

    Swift

    public struct JSONEncoding : ParameterEncoding
  • Redirector is a convenience RedirectHandler making it easy to follow, not follow, or modify a redirect.

    See more

    Declaration

    Swift

    public struct Redirector
    extension Redirector: RedirectHandler
  • Stores all state associated with a URLRequest being adapted.

    See more

    Declaration

    Swift

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

    See more

    Declaration

    Swift

    public struct DataResponse<Success, Failure> where Failure : Error
    extension DataResponse: CustomStringConvertible, CustomDebugStringConvertible
  • Used to store all data associated with a serialized response of a download request.

    See more

    Declaration

    Swift

    public struct DownloadResponse<Success, Failure> where Failure : Error
    extension DownloadResponse: CustomStringConvertible, CustomDebugStringConvertible

Protocols

URL

Empty

DataStreamRequest