Vapor Documentation Beta

Protocol Content​Encoder

public protocol ContentEncoder
%3 ContentEncoder ContentEncoder FormDataEncoder FormDataEncoder FormDataEncoder->ContentEncoder URLEncodedFormEncoder URLEncodedFormEncoder URLEncodedFormEncoder->ContentEncoder PlaintextEncoder PlaintextEncoder PlaintextEncoder->ContentEncoder

Types Conforming to Content​Encoder

PlaintextEncoder

Encodes data as plaintext, utf8.

FormDataEncoder

Encodes Encodable items to multipart/form-data encoded Data.

URLEncodedFormEncoder

Encodes Encodable instances to application/x-www-form-urlencoded data.

Requirements

encode(_:​to:​headers:​)

func encode<E>(_ encodable: E, to body: inout ByteBuffer, headers: inout HTTPHeaders) throws where E: Encodable