Back to Alamofire

Type Aliases

docs/Typealiases.html

5.12.02.5 KB
Original Source

Type Aliases

The following type aliases are available globally.

`

                Parameters
                `

A dictionary of parameters to apply to a URLRequest.

Declaration

Swift

public typealias Parameters = [String : any Sendable]

`

                AFDataResponse
                `

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

Declaration

Swift

public typealias AFDataResponse<Success> = DataResponse<Success, AFError>

`

                AFDownloadResponse
                `

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

Declaration

Swift

public typealias AFDownloadResponse<Success> = DownloadResponse<Success, AFError>

`

                AFResult
                `

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

Declaration

Swift

public typealias AFResult<Success> = Result<Success, AFError>

`

                AdaptHandler
                `

RequestAdapter closure definition.

Declaration

Swift

public typealias AdaptHandler = @Sendable (_ request: URLRequest,
                                           _ session: Session,
                                           _ completion: @escaping @Sendable (Result<URLRequest, any Error>) -> Void) -> Void

`

                RetryHandler
                `

RequestRetrier closure definition.

Declaration

Swift

public typealias RetryHandler = @Sendable (_ request: Request,
                                           _ session: Session,
                                           _ error: any Error,
                                           _ completion: @escaping @Sendable (RetryResult) -> Void) -> Void

Server Trust Evaluators

`

                DisabledEvaluator
                `

Disables all evaluation which in turn will always consider any server trust as valid.

Note

Instead of disabling server trust evaluation, it’s a better idea to configure systems to properly trust test certificates, as outlined in this Apple tech note.

THIS EVALUATOR SHOULD NEVER BE USED IN PRODUCTION!

Declaration

Swift

@available(*, deprecated, renamed: "DisabledTrustEvaluator", message: "DisabledEvaluator has been renamed DisabledTrustEvaluator.")
public typealias DisabledEvaluator = DisabledTrustEvaluator