DevRainSolutions.KyivSmartCity.New.Models.ReCaptchaClass.Validate C# (CSharp) Method

Validate() public static method

public static Validate ( string encodedResponse ) : string
encodedResponse string
return string
        public static string Validate(string encodedResponse)
        {
            var client = new System.Net.WebClient();

            var GoogleReply = client.DownloadString(
                string.Format("https://www.google.com/recaptcha/api/siteverify?secret={0}&response={1}",
                    Recaptcha.SecretKey, encodedResponse));

            var captchaResponse = JsonConvert.DeserializeObject<ReCaptchaClass>(GoogleReply);

            return captchaResponse.Success;
        }
ReCaptchaClass