takeFrom

fun <T> takeFrom(serializer: SerializationStrategy<T>, value: T, jsonInstance: Json = Jwt.defaultJsonParser)(source)

Merges all fields from value into this builder, encoded using serializer.

The object is serialized to a JsonObject and each key-value pair is added to the header, overwriting any existing parameter with the same name.

Parameters

serializer

the serialization strategy for T

value

the object whose fields should be merged into the header

jsonInstance

the Json instance to use for serialization; defaults to the library's Jwt.defaultJsonParser configuration (ignoreUnknownKeys = true, explicitNulls = false)


inline fun <T> takeFrom(value: T)(source)

Merges all fields from value into this builder, inferring the serializer from the reified type T.

The object is serialized to a JsonObject and each key-value pair is added to the header, overwriting any existing parameter with the same name.

Parameters

value

the object whose fields should be merged into the header