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!