最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

.net - Recaptcha verify always returns invalid-input-response - Stack Overflow

programmeradmin1浏览0评论

I try to verify recaptcha token on server side, and always get invalid-input-response. here is my code:

using var client = new HttpClient();

var values = new Dictionary<string, string>
{
    { "secret", secretKey },
    { "response", request.Token }
};

var content = new FormUrlEncodedContent(values);
content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded"); // Explicitly setting the Content-Type

var response = await client.PostAsync(";, content);
var jsonResponse = await response.Content.ReadAsStringAsync();

I also tried the request on postman - getting the same error. (I try only once for each token, and than generate token again and so on)

the token is good. so what's the issue? and the weired thing is - that when I send wrong secret - it doesn't alert invalid-input-secret, but returns the same error of the response.

I really don't know what to do, any help or advice will be appreciated!

发布评论

评论列表(0)

  1. 暂无评论