title: How to Asynchrounsly call HTTP Post API?
body: <p>I have an issue with my android app. I'm fairly new with it and have some issues with finding the correct documentation for a asynchronous. I'm using the kohttp library to help me a bit. </p>
  
  <p>The thing is, you can't run this on the main UI thread so I want to make this request Async. I can't find a clear reference in the documentation and I don't really know how to do this in plain Kotlin.</p>
  
  <p>This is what I come up with; in a separate class named <code>LoginCall</code>. I tried other answers, this however didn't result in success. How can I run this on a new thread and still use the response?</p>
  
  <pre><code>    class LoginCall {
      fun callLoginRequest(a:String, b:String): Any {
  
          val response: Response = httpPost {
              host = "XXX"
              path = "XXX"
  
              param { }
              header { }
  
              body {
                  form {
                      "email" to a
                      "password" to b
                  }
              }
          }
  
          return response
      }
  }
  </code></pre>