ParameterEncoder - SwiftDocOrg/Alamofire GitHub Wiki
ParameterEncoder
A type that can encode any Encodable type into a URLRequest.
public protocol ParameterEncoder
Requirements
encode(_:βinto:β)
Encode the provided Encodable parameters into request.
func encode<Parameters:β Encodable>(_ parameters:β Parameters?, into request:β URLRequest) throws -> URLRequest
Parameters
- parameters:β The
Encodableparameter value. - request:β The
URLRequestinto which to encode the parameters.
Throws
An Error when encoding fails. For Alamofire provided encoders, this will be an instance of AFError.parameterEncoderFailed with an associated ParameterEncoderFailureReason.
Returns
A URLRequest with the result of the encoding.