Computer scienceBackendKtorKtor Client

Ktor Client: First view

Theory

POST request

Report a typo

The code below makes an HTTP POST request to example.com and outputs the response code to the console.

Put the lines of code in the correct order and set the indentation.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                }
              
                val client = HttpClient(CIO)
              
                }
              
                val response: HttpResponse = client.post("https://example.com") {
              
                append(HttpHeaders.Accept, "application/json")
              
                println(response.status)
              
                client.close()
              
                headers {
              

Create a free account to access the full topic