The code below downloads the icon from the google server and saves it in a file in a temporary folder.
Put the lines of code in the correct order and set the indentation.
The code below downloads the icon from the google server and saves it in a file in a temporary folder.
Put the lines of code in the correct order and set the indentation.
val response: HttpResponse = client.get("https://www.google.com/favicon.ico")
}
File.createTempFile("files", "myicon.ico").writeBytes(byteArrayBody)
suspend fun main(args: Array<String>) {
val byteArrayBody: ByteArray = response.body()
val client = HttpClient(CIO)
client.close()
Create a free account to access the full topic