Type Aliases

The following type aliases are available globally.

  • A dictionary of parameters to apply to a URLRequest.

    Declaration

    Swift

    public typealias Parameters = [String : any Sendable]
  • Default type of DataResponse returned by Alamofire, with an AFError Failure type.

    Declaration

    Swift

    public typealias AFDataResponse<Success> = DataResponse<Success, AFError>
  • Default type of DownloadResponse returned by Alamofire, with an AFError Failure type.

    Declaration

    Swift

    public typealias AFDownloadResponse<Success> = DownloadResponse<Success, AFError>
  • Default type of Result returned by Alamofire, with an AFError Failure type.

    Declaration

    Swift

    public typealias AFResult<Success> = Result<Success, AFError>
  • RequestAdapter closure definition.

    Declaration

    Swift

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

  • 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