use(encoder:for:)
Adds a ContentEncoder
for the specified HTTPMediaType
.
mutating func use(encoder: ContentEncoder, for mediaType: HTTPMediaType)
Parameters
- encoder
ContentEncoder
to use.- mediaType
ContentEncoder
will be used to encode thisHTTPMediaType
.
contentConfig.use(encoder: JSONEncoder(), for: .json)