title: How to use Fuel with a Kotlin coroutine
body: <p>Within an Android app, I'm trying to use <a href="https://github.com/kittinunf/Fuel" rel="nofollow noreferrer">Fuel</a> to make an HTTP request within a Kotlin coroutine. My first try is to use the synchronous mode inside a wrapper like this:</p>
  
  <pre><code>launch(UI) {
      val token = getToken()
      println(token)
  }
  
  suspend fun getToken(): String? {
      var (request, response, result = TOKEN_URL.httpGet().responseString()
      return result.get()
  }
  </code></pre>
  
  <p>But that is returning an <code>android.os.NetworkOnMainThreadException</code>. The Fuel documentation mentions .await() and .awaitString() extensions but I haven't figured it out.</p>
  
  <p>What is the best way to make a Fuel http request within a Kotlin coroutine from the main UI thread in an Android application? Stuck on this - many thanks...</p>