AlamofireImpl
open class AlamofireImpl : NSObject, RequestPlugin, @unchecked Sendable
Alamofire请求插件,启用Alamofire子模块后生效
-
单例模式
Declaration
Swift
@objc(sharedInstance) public static let shared: AlamofireImpl
-
SessionConfiguration配置,默认nil
Declaration
Swift
open var sessionConfiguration: URLSessionConfiguration
-
全局intercepter配置,默认nil
Declaration
Swift
open var intercepter: RequestInterceptor?
-
服务器信任管理器,默认nil
Declaration
Swift
open var serverTrustManager: ServerTrustManager?
-
重定向处理句柄,默认nil
Declaration
Swift
open var redirectHandler: RedirectHandler?
-
缓存响应处理句柄,默认nil
Declaration
Swift
open var cachedResponseHandler: CachedResponseHandler?
-
事件模拟器数组,默认空
Declaration
Swift
open var eventMonitors: [EventMonitor]
-
自定义请求intercepter句柄,如配置RetryPolicy等,默认nil
Declaration
Swift
open var requestIntercepterBlock: (@Sendable (HTTPRequest) -> RequestInterceptor?)?
-
是否移除响应JSON中的NSNull值,默认true
Declaration
Swift
open var removeNullValues: Bool
-
有效状态码范围,默认为(100-600)
Declaration
Swift
open var acceptableStatusCodes: [Int]
-
有效的contentType列表,默认nil不修改
Declaration
Swift
open var acceptableContentTypes: [String]?
-
会话,延迟加载前可配置
Declaration
Swift
open lazy var session: Session { get set }
-
Declaration
Swift
open func buildUrlRequest(for request: HTTPRequest) throws -> URLRequest
-
Declaration
Swift
open func startDataTask(for request: HTTPRequest, completionHandler: (@Sendable (URLResponse, Any?, Error?) -> Void)?)
-
Declaration
Swift
open func startDownloadTask(for request: HTTPRequest, resumeData: Data?, destination: String, completionHandler: (@Sendable (URLResponse, URL?, Error?) -> Void)?)
-
Declaration
Swift
open func suspendRequest(_ request: HTTPRequest)
-
Declaration
Swift
open func resumeRequest(_ request: HTTPRequest)
-
Declaration
Swift
open func cancelRequest(_ request: HTTPRequest)