serialize

fun <T> serialize(entity: T, type: Class<T>): RequestBody

Serializes an entity using the first serializer.

Return

The serialized entity as a request body.

Parameters

entity

The entity to serialize.

T

The type of entity to serialize.