ParameterEncoder
public protocol ParameterEncoder
A type that can encode any Encodable
type into a URLRequest
.
-
Encode the provided
Encodable
parameters intorequest
.Throws
An
Error
when encoding fails. For Alamofire provided encoders, this will be an instance ofAFError.parameterEncoderFailed
with an associatedParameterEncoderFailureReason
.Declaration
Swift
func encode<Parameters>(_ parameters: Parameters?, into request: URLRequest) throws -> URLRequest where Parameters : Encodable
Parameters
parameters
The
Encodable
parameter value.request
The
URLRequest
into which to encode the parameters.Return Value
A
URLRequest
with the result of the encoding.