Target filter
Search Kotlin docs
  • Platforms
  • Tealium Prism Kotlin
core/com.tealium.prism.core.api.network/HttpResponse/bodyText

bodyText

@JvmOverloads
fun bodyText(fallbackCharset: Charset = Charsets.UTF_8): String?

Utility method to read the body as a String.

If the content-encoding header is gzip, then the body will be unzipped.

If the content-type header specifies a charset, then it will be used to convert the body to a String. If no charset is present in the header, then a fallbackCharset can be specified to read the body, otherwise it will default to UTF-8

Parameters

fallbackCharset

optional charset to read the bytes; default is Charsets.UTF_8

Generated by Dokka
(c) Tealium 2026