kotlin-stdlib / kotlin.io / java.net.URL / readText readText JVM 1.0 fun URL.readText(charset: Charset = Charsets.UTF_8): String(source) Reads the entire content of this URL as a String using UTF-8 or the specified charset. This method is not recommended on huge files. Parameters charset - a character set to use. Return a string with this URL entire content.