Skip to content

Instantly share code, notes, and snippets.

@HamidMosalla
Created February 8, 2017 10:47
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 HamidMosalla/8919dada91f67d6b03f8324278430a2b to your computer and use it in GitHub Desktop.
Save HamidMosalla/8919dada91f67d6b03f8324278430a2b to your computer and use it in GitHub Desktop.
public class CaptchaValidator : ICaptchaValidator
{
private readonly HttpClient _httpClient;
public CaptchaValidator(HttpClient httpClient)
{
_httpClient = httpClient;
}
public async Task<CaptchaResponse> ValidateCaptchaAsync()
{
_httpClient.BaseAddress = new Uri("https://www.google.com/");
_httpClient.DefaultRequestHeaders.Accept.Clear();
_httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await _httpClient.GetAsync($"recaptcha/api/siteverify");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment