code: public static boolean isRequestSuccessful(org.apache.http.HttpResponse response) {
          int status = response.getStatusLine().getStatusCode();
          return status / 100 == HttpStatus.SC_OK / 100;
      }
docs: Checks if the request was successful or not based on the status code.
  
  @param response HTTP response
  @return True if the request was successful (i.e. has a 2xx status code), false otherwise.