code: public void pingAgent() {
  
          HTTP.Response response = HTTP.getResponse(createURI("/self").toString());
  
          if (response.status() != 200) {
              die("Error pinging Consul", response.payloadAsString());
          }
      }
docs: Pings the Consul Agent.