Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Instance Method

decode(_:from:headers:userInfo:)

“Decode object” method. The provided Foundation/Data should be decoded as a value of the given type, optionally guided by the provided HTTPFields. The provided userInfo dictionary must be forwarded to the underlying Swift/Decoder used to perform the decoding operation.
func decode<D>(_ decodable: D.Type, from body: Data, headers: HTTPFields, userInfo: [CodingUserInfoKey : any Sendable]) throws -> D where D : Decodable