Instance Methodvapor 4.114.1Vapor

use(encoder:for:)

Adds a ContentEncoder for the specified HTTPMediaType.

ContentConfiguration.swift:87
mutating func use(encoder: ContentEncoder, for mediaType: HTTPMediaType)

Parameters

encoder

ContentEncoder to use.

mediaType

ContentEncoder will be used to encode this HTTPMediaType.

contentConfig.use(encoder: JSONEncoder(), for: .json)