RequestConverter

public protocol RequestConverter

A protocol that converts RestingRequests to HTTPRequest.

  • Converts the given RestingRequest to an HTTPRequest.

    Implementations should use the forUpload to determine if the generated request should be streamed or not. If forUpload is true, it is expected that the returned request is streamed. If set to false, implementations are allowed chose wheter the request is streamed or not.

    Declaration

    Swift

    func toHTTPRequest<RequestType: Encodable, ResponseType: Decodable>(
        _ request: RestingRequest<RequestType, ResponseType>,
        baseUrl: String,
        forUpload: Bool) throws -> HTTPRequest

    Parameters

    request

    The RestingRequest to converter.

    baseUrl

    The base URL to use for the request.

    forUpload

    Wether the conversion is for an upload request or not.