-
-
Save HamidMosalla/8919dada91f67d6b03f8324278430a2b 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
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