Skip to content

Instantly share code, notes, and snippets.

@zs40x
Last active March 26, 2016 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zs40x/fafd9036a74fd5269160 to your computer and use it in GitHub Desktop.
Save zs40x/fafd9036a74fd5269160 to your computer and use it in GitHub Desktop.
class WhoisLookup
{
private readonly string webApiBaseAddress = "http://api.hackertarget.com/whois/?q=";
public string HostToLookup { get; private set; }
public WhoisLookup(string hostToLookup)
{
HostToLookup = hostToLookup;
}
public async Task<string> GetWhoisInformationsAsync()
{
var client = new HttpClient();
var apiRequestUrl = $"{webApiBaseAddress}{HostToLookup}";
var getContentAsStringTask = client.GetStringAsync(apiRequestUrl);
return await getContentAsStringTask;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment