RequestBody

expect abstract class RequestBody
actual abstract class RequestBody

Inheritors

actual abstract class RequestBody

Constructors

Link copied to clipboard
expect constructor()
constructor()
constructor()

Types

Link copied to clipboard
expect object Companion
actual object Companion
actual object Companion

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect 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.

actual open fun contentLength(): Long
actual open fun contentLength(): Long
Link copied to clipboard
expect abstract fun contentType(): MediaType?

Returns the Content-Type header for this body.

actual abstract fun contentType(): MediaType?
actual abstract fun contentType(): MediaType?
Link copied to clipboard

Returns a gzip version of the RequestBody, with compressed payload. This is not automatic as not all servers support gzip compressed requests.

Link copied to clipboard
expect open fun isDuplex(): Boolean

A duplex request body is special in how it is transmitted on the network and in the API contract between OkHttp and the application.

actual open fun isDuplex(): Boolean
actual open fun isDuplex(): Boolean
Link copied to clipboard
expect open fun isOneShot(): Boolean

Returns true if this body expects at most one call to writeTo and can be transmitted at most once. This is typically used when writing the request body is destructive and it is not possible to recreate the request body after it has been sent.

actual open fun isOneShot(): Boolean
actual open fun isOneShot(): Boolean
Link copied to clipboard
expect abstract fun writeTo(sink: BufferedSink)

Writes the content of this request to sink.

actual abstract fun writeTo(sink: BufferedSink)
actual abstract fun writeTo(sink: BufferedSink)