code: protected void validateHttpResponse(int statusCode, String responseMessage) throws HttpProtocolException {
          if (statusCode != HttpURLConnection.HTTP_OK) {
              throw new HttpProtocolException(statusCode, responseMessage);
          }
      }
docs: Validates HTTP response message.
  
  @param statusCode
  HTTP status code.
  @param responseMessage
  HTTP header response message.
  @throws HttpProtocolException
  will be thrown when HTTP status code is not 200 and response doesn't include data,
  or HTTP status code is not 200 and response content type isn't
  "application/ksi-response".