public static IToCaptchaResponse Res(string captchaId) { using (var hc = new HttpClient()) { var result = hc.GetAsync($"http://2captcha.com/res.php?key={APIKey}&action=get&id={captchaId}").Result; var resposta = result.Content.ReadAsStringAsync().Result; return(ToCaptchaResponse.From(resposta)); } }
public static IToCaptchaResponse In(string base64) { using (var hc = new HttpClient()) { var result = hc.PostAsync("http://2captcha.com/in.php", new FormUrlEncodedContent(new[] { new KeyValuePair <string, string>("method", "base64"), new KeyValuePair <string, string>("key", APIKey), new KeyValuePair <string, string>("body", base64), })).Result; var resposta = result.Content.ReadAsStringAsync().Result; return(ToCaptchaResponse.From(resposta)); } }