Instance Method
decode(_:from:headers:)
Legacy “decode object” method. The provided
NIOCore/ByteBuffer should be decoded as a value of the given type, optionally guided by the provided HTTPHeaders.func decode<D>(_: D.Type, from body: ByteBuffer, headers: HTTPHeaders) throws -> D where D : Decodable
Discussion
Most decoders should implement this method by simply forwarding it to the decoder userInfo-aware version below, e.g. try self.decode(D.self, from: body, headers: headers, userInfo: [:]). For legacy API compatibility reasons, the default protocol conformance will do the exact opposite.