title: Can I use response in if () in kotlin?
body: <p>I try to create kotlin app with OkHttp3. Can I use <code>response.header("error")</code> or <code>response.header("success")</code> in <code>if()</code>?
  For example, if I got response with error I will show error or if I get <code>success</code> and I can start next activity to show in next activity <code>header("username")</code>.
  My request fun:</p>
  
  <pre><code>fun requestAuth(url: String) {
          var param = FormBody.Builder()
              .add("login", login.text.toString())
              .add("password", password.text.toString())
              .build()
          val request = Request.Builder().url(url).post(param).build()
          val client = OkHttpClient()
              .newBuilder()
              .build()
          client.newCall(request).enqueue(object : Callback{
  
              override fun onResponse(call: Call, response: Response) {
  //                startActivity(Intent(this@Login, NavigationMenu::class.java)
  //                    .putExtra("session_token", response
  //                        .header("session_token")
  //                        .toString())
                        .putExtra("username", response.header("username").toString()))
              }
  
  </code></pre>
  
  <p>Thank you for every suggestion</p>