示例#1
0
        public bool VerifyCaptcha(string secret, string token)
        {
            var client  = _restClientWrapper.GetClient(_configuration.GoogleRecaptchaVerifyUrl);
            var request = _restClientWrapper.RestRequest("", Method.POST);

            request.AddParameter("secret", secret);
            request.AddParameter("response", token);

            var response = client.Execute(request);

            dynamic content = JsonConvert.DeserializeObject(response.Content);

            return(content.success);
        }
示例#2
0
        public string WildcardLookup(string name)
        {
            name = "House=All|name*" + name;
            var client  = _restClientWrapper.GetClient(_configurationService.GetMemberAutocompleteApi);
            var request = _restClientWrapper.RestRequest(name, Method.GET);

            var response = client.Execute(request);

            if (response.StatusCode == HttpStatusCode.NotFound)
            {
                return(null);
            }
            if (response.StatusCode != HttpStatusCode.OK)
            {
                throw new RestSharpException();
            }

            return(response.Content);
        }