code: public static boolean hasResponseBody(String requestMethod, int responseCode) {
          return requestMethod != Request.Method.HEAD
                  && !(100 <= responseCode && responseCode < HttpURLConnection.HTTP_OK)
                  && responseCode != HttpURLConnection.HTTP_NO_CONTENT
                  && responseCode != HttpURLConnection.HTTP_RESET
                  && responseCode != HttpURLConnection.HTTP_NOT_MODIFIED;
      }
docs: Checks if a response message contains a body.
  
  @param requestMethod request method
  @param responseCode  response status code
  @return whether the response has a body
  @see <a href="https://tools.ietf.org/html/rfc7230#section-3.3">RFC 7230 section 3.3</a>