private int parseProtocolArgs(String[] args, int index) throws HadoopIllegalArgumentException {
      // make sure only -protocol is specified
      if (protocol != null) {
        throw new HadoopIllegalArgumentException("Redundant -protocol command");
      }
      // check number of arguments is sufficient
      if (index + 1 >= args.length) {
        throw new HadoopIllegalArgumentException("-protocol needs one parameter");
      }
      // check protocol is valid
      protocol = args[index + 1];
      if (!isValidProtocol(protocol)) {
        throw new HadoopIllegalArgumentException("Invalid protocol: " + protocol);
      }
      return index + 2;
    }
Send HTTP request to the daemon.
@throws HadoopIllegalArgumentException if arguments are invalid.
@throws Exception                      if unable to connect
hbase-http/src/main/java/org/apache/hadoop/hbase/http/log/LogLevel.java