code: public JSONObject getResponseJSON() {
          String responseText = getResponseText();
  
          if(responseText == null || responseText.length() == 0){
              return null;
          }
  
          try {
              return new JSONObject(responseText);
          } catch (JSONException e) {
              logger.warn("Failed to extract JSON from response body. Error: " + e.getMessage());
              return null;
          }
      }
docs: This method parses the response body as a JSONObject.
  If this method is called, then subsequent calls to {@link #getResponseByteStream()} or {@link #getResponseBytes()}
  will return null unless the {@link Request} was made using a <code>download()</code> method.
  
  @return The body of the response as a JSONObject.