EncodedBody

data class EncodedBody(val body: String, val base64Encoded: Boolean)

Represents an encoded body of a network response.

This class encapsulates the body of a response, indicating whether it is base64 encoded or not. It also provides a way to decode the body, handling both base64 encoded and plain text responses.

Constructors

Link copied to clipboard
constructor(getResponseBodyReturn: Network.GetResponseBodyReturn)

Constructs an EncodedBody from a Network.GetResponseBodyReturn object.

constructor(getResponseBodyReturn: Fetch.GetResponseBodyReturn)

Constructs an EncodedBody from a Fetch.GetResponseBodyReturn object.

constructor(body: String, base64Encoded: Boolean)

Properties

Link copied to clipboard

Indicates whether the body is base64 encoded. If true, the body should be decoded using Base64 decoding. Use the decodedBody property to access the decoded body.

Link copied to clipboard

The body of the response, which may be base64 encoded or plain text. Use the decodedBody property to get the decoded version of this body.

Link copied to clipboard

Decodes the body of the response.