title: How to get header from the server? Retrofit 2
body: <p>When I'm logging to my server I should get the respond with "x-auth-token" but I don't know how? </p>
  
  <p>In Java it was simply:</p>
  
  <p>token = urlConnection.getHeaderField("x-auth-token");</p>
  
  <p>I have tried already like that:</p>
  
  <pre><code>LoginService loginService = ServiceGenerator.createService(LoginService.class,loginEmail,loginPassword);
                  Call&lt;User&gt; call = loginService.basicLogin();
                  call.enqueue(new Callback&lt;User&gt;() {
  
  
                      @Override
                      public void onResponse(Call&lt;User&gt; call, Response&lt;User&gt; response) {
  
  
                          okhttp3.Headers headers = response.headers();
                          String token = response.headers().get("x-auth-token");
                          Log.e(LOG_TAG, "My token is" + token);
  
  
  
                              Toast.makeText(getApplicationContext(),"You have been logged", Toast.LENGTH_SHORT).show();
  </code></pre>
  
  <p>After that I'm getting response , that my x-auth-token = null;</p>