AnyRequestAdapter

public struct AnyRequestAdapter : RequestAdapter

Provides an easy way to create a RequestAdapter object with a block.

  • Initializes an AnyRequestAdapter object with a closure.

    Declaration

    Swift

    public init(_ block: @escaping (URLRequest) throws -> URLRequest)

    Parameters

    block

    A closure to be invoked with an input URLRequest object.

  • Adapts an input URLRequest object and returns a modified object.

    Throws

    An error during the adapting process.

    Note

    This method just invokes block received from the initializer.

    Declaration

    Swift

    public func adapted(_ request: URLRequest) throws -> URLRequest

    Parameters

    request

    The request to be adapted.

    Return Value

    The modified URLRequest object.