RequestConverter
public protocol RequestConverter
A protocol that converts RestingRequests to HTTPRequest.
-
Converts the given
RestingRequestto anHTTPRequest.Implementations should use the
forUploadto determine if the generated request should be streamed or not. IfforUploadistrue, 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 -> HTTPRequestParameters
requestThe
RestingRequestto converter.baseUrlThe base URL to use for the request.
forUploadWether the conversion is for an upload request or not.
RequestConverter Protocol Reference