title: How to read the status code of Okhttp response in android
body: <h2>My Current code:</h2>
  
  <pre><code>public static InputStream postRequestWithPayload(String url, String mJsonReq) throws Exception {
           Response response;
           try{
              RequestBody body = RequestBody.create(JSON, mJsonReq);
              client.setConnectTimeout(20, TimeUnit.SECONDS); // connect timeout
              client.setReadTimeout(20, TimeUnit.SECONDS);    // socket timeout
              Request request = new Request.Builder()
                      .url(url)
                      .post(body)
                      .addHeader(AppConstants.OKHTTP_HEADER_GENERAL_USERNAME, AppController.getUserName())
                      .addHeader(AppConstants.OKHTTP_HEADER_GENERAL_AUTHTOLKEN, AppController.getToken().toString())
                              //.addHeader(AppConstants.OKHTTP_HEADER_GENERAL_APP_IDENTIFIER, AppConstants.OKHTTP_HEADER_GENERAL_APP_IDENTIFIER_VALUE)
                      .build();
              response = client.newCall(request).execute();
  
          }catch(Exception e){
              throw e;
           }
           return response.body().byteStream();
       }
  </code></pre>
  
  <h2>What i am trying to do:</h2>
  
  <ol>
  <li>I am trying to read the status code of the response  </li>
  <li>How to achieve this</li>
  </ol>