Last active
March 26, 2016 08:28
-
-
Save zs40x/fafd9036a74fd5269160 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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