AnyRequestAdapter
public struct AnyRequestAdapter : RequestAdapter
Provides an easy way to create a RequestAdapter object with a block.
-
Initializes an
AnyRequestAdapterobject with a closure.Declaration
Swift
public init(_ block: @escaping (URLRequest) throws -> URLRequest)Parameters
blockA closure to be invoked with an input
URLRequestobject. -
Adapts an input
URLRequestobject and returns a modified object.Throws
An error during the adapting process.Note
This method just invokesblockreceived from the initializer.Declaration
Swift
public func adapted(_ request: URLRequest) throws -> URLRequestParameters
requestThe request to be adapted.
Return Value
The modified
URLRequestobject.
View on GitHub
AnyRequestAdapter Structure Reference