RouteConfiguration

public final class RouteConfiguration

Route configuration class which is used in Route protocol implementations.

  • Route configuration initializer

    Declaration

    Swift

    public init(method: Method,
                path: Path,
                params: [String: Any?]? = nil,
                headers: [String: String]? = nil,
                configuration: Configuration? = nil,
                mockFilePath: Path? = nil)

    Parameters

    method

    A Method to use, for example .get, .post, etc.

    path

    A path of the request (will be appended to the base URL, for example .path([“user”, “13”]).

    params

    The parameters of the request.

    headers

    A configuration object (Optional, e.g. if you want ot use custom configuration for a specific route).

    configuration

    The configuration object of the request.

    mockFilePath

    A path of the file in the mock data bundle specified in configuration object. This will be used only if useMockData is set to true in the configuration object.