//okhttp/okhttp3/RequestBody/Companion/gzip
gzip¶
[jvm]\
fun RequestBody.gzip(): RequestBody
Returns a gzip version of the RequestBody, with compressed payload. This is not automatic as not all servers support gzip compressed requests.
val request = Request.Builder().url("...")
.addHeader("Content-Encoding", "gzip")
.post(uncompressedBody.gzip())
.build()