RequestConfig
open class RequestConfig : @unchecked Sendable
请求配置类
-
Undocumented
Declaration
Swift
public static let shared: RequestConfig
-
自定义请求插件,未设置时自动从插件池加载
Declaration
Swift
open var requestPlugin: RequestPlugin! { get set }
-
当前请求重试器,默认全局重试器,可清空
Declaration
Swift
open var requestRetrier: RequestRetrierProtocol?
-
当前请求验证器,默认全局验证器,可清空
Declaration
Swift
open var requestValidator: RequestValidatorProtocol?
-
当前请求缓存,默认文件缓存,可清空
Declaration
Swift
open var requestCache: RequestCacheProtocol?
-
请求过滤器数组
Declaration
Swift
open private(set) var requestFilters: [RequestFilterProtocol] { get }
-
请求基准地址
Declaration
Swift
open var baseUrl: String
-
请求CDN地址
Declaration
Swift
open var cdnUrl: String
-
是否后台预加载数据模型过滤句柄,默认nil
Declaration
Swift
open var preloadModelFilter: (@Sendable (HTTPRequest) -> Bool)?
-
是否预加载请求缓存过滤句柄(一般仅GET开启),注意开启后当缓存存在时会调用成功句柄一次,默认nil
Declaration
Swift
open var preloadCacheFilter: (@Sendable (HTTPRequest) -> Bool)?
-
自定义缓存敏感数据过滤句柄,默认nil
Declaration
Swift
open var cacheSensitiveFilter: (@Sendable (HTTPRequest) -> Any?)?
-
自定义请求上下文配件句柄,默认nil
Declaration
Swift
open var contextAccessoryBlock: (@Sendable (HTTPRequest) -> RequestContextAccessory)?
-
是否启用调试
Declaration
Swift
open var debugLogEnabled: Bool
-
是否启用调试Mock
Declaration
Swift
open var debugMockEnabled: Bool
-
调试Mock验证器,默认nil
Declaration
Swift
open var debugMockValidator: (@Sendable (HTTPRequest) -> Bool)?
-
调试Mock处理器,默认nil
Declaration
Swift
open var debugMockProcessor: (@Sendable (HTTPRequest) -> Bool)?
-
Undocumented
Declaration
Swift
public init()
-
添加请求过滤器
Declaration
Swift
open func addRequestFilter(_ fileter: RequestFilterProtocol)
-
清空所有请求过滤器
Declaration
Swift
open func clearRequestFilters()