BodyEncoder
public protocol BodyEncoder : AnyObject
A class that conforms to BodyEncoder
must be able to encode a Codable
type into Data
.
This class can then be used to produce output objects for a Codable route.
-
Encode an
Encodable
type to aData
, using thisBodyEncoder
.Declaration
Swift
func encode<T>(_ value: T) throws -> Data where T : Encodable