Google RECAPTCHA始终在响应中返回错误缺失 - 输入 - 响应

时间:2017-05-22 15:30:14

标签: recaptcha

当我尝试检查正确性时,Google RECAPTCHA总是在响应中返回错误 - 输入 - 响应。对服务的调用如何转到URL https://www.google.com/recaptcha/api/siteverify

2 个答案:

答案 0 :(得分:1)

格式为: HTTPS:// ... / API / siteverify秘密= [...]&安培;响应= [...]&安培; remote_ip = [...]

答案 1 :(得分:1)

确保Content-Type设置为application/x-www-form-urlencoded

.Net示例

using (HttpClient httpClient = new HttpClient())
{
var response = await httpClient.PostAsync(GoogleVerificationUrl + "?secret=" + ReCaptchaSecretKey + "&response=" + ReCaptchaResponse, new StringContent("", Encoding.UTF8, "application/x-www-form-urlencoded"));                                        
}