RequestConverter
public protocol RequestConverter
A protocol that converts RestingRequest
s to HTTPRequest
.
-
Converts the given
RestingRequest
to anHTTPRequest
.Implementations should use the
forUpload
to determine if the generated request should be streamed or not. IfforUpload
istrue
, it is expected that the returned request is streamed. If set tofalse
, 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.