okhttp / okhttp3 / RequestBody / contentLength

contentLength

open fun contentLength(): Long

Returns the number of bytes that will be written to sink in a call to writeTo, or -1 if that count is unknown.