Blocking mode

Unlike in asynchronous mode, in blocking mode the thread is blocked until the response is returned from the URL. It has exact parameters and features that are similar to asynchronous mode, except for the callback:

    val (request, response, result) =        "https://newsapi.org/".httpGet().responseString()

Get Kotlin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.