Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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