Class WhoisHttpAction

  • All Implemented Interfaces:
    java.lang.Runnable

    public final class WhoisHttpAction
    extends java.lang.Object
    implements java.lang.Runnable
    Human-Friendly HTTP WHOIS API

    This API uses easy to understand paths rather than WhoisAction which requires a POST request containing a WHOIS command. Because the typical WHOIS command is along the lines of "domain google.lol" or the equivalent "google.lol, this action is just going to replace the slashes with spaces and let WhoisReader figure out what to do.

    This action accepts requests from any origin.

    You can send AJAX requests to our WHOIS API from your very own website using the following embed code:

    
     <input id="query-input" placeholder="Domain, Nameserver, IP, etc." autofocus>
     <button id="search-button">Lookup</button>
     <pre id="whois-results"></pre>
     <script>
      (function() {
        var WHOIS_API_URL = 'https://domain-registry-alpha.appspot.com/whois/';
        function OnKeyPressQueryInput(ev) {
          if (typeof ev == 'undefined' && window.event) {
            ev = window.event;
          }
          if (ev.keyCode == 13) {
            document.getElementById('search-button').click();
          }
        }
        function OnClickSearchButton() {
          var query = document.getElementById('query-input').value;
          var req = new XMLHttpRequest();
          req.onreadystatechange = function() {
            if (req.readyState == 4) {
              var results = document.getElementById('whois-results');
              results.textContent = req.responseText;
            }
          };
          req.open('GET', WHOIS_API_URL + escape(query), true);
          req.send();
        }
        document.getElementById('search-button').onclick = OnClickSearchButton;
        document.getElementById('query-input').onkeypress = OnKeyPressQueryInput;
      })();
     </script>
     
    See Also:
    WhoisAction
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PATH  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable