Instance Methodvapor 4.114.1Vapor

requireEncoder(for:)

Returns an ContentEncoder for the specified HTTPMediaType or throws an error.

ContentConfiguration.swift:116
func requireEncoder(for mediaType: HTTPMediaType) throws -> ContentEncoder
let coder = try ContentConfiguration.global.requireEncoder(for: .json)