toJsonRequestBody

inline fun <T> T.toJsonRequestBody(): RequestBody

Converts an object of type T to a RequestBody with JSON content type.

Receiver

The object to be converted to a RequestBody.

Return

A RequestBody containing the JSON representation of the receiver object.