我想验证从输入表单获得的验证码。有了这个秘密和答案,我在3个小时内尝试了我在网上找到的所有方法。但无法解决问题。下面是我的代码:
const app = express()
app.get('/check', async (req, res) => {
const result = await axios.post(
`https://www.google.com/recaptcha/api/siteverify?secret=${secret}&response=${response}`,
{},
{
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8"
},
},
);
return res.send(result.data);
})
����RPP*.MNN-.V�RHK�)N�����&秤�ģ�B@�̼�Ĝ��̼��ݢ�����T%�d,W-�� K
,输出如下:
感谢你的帮助
尝试更新到v1.21,我看到了同样的问题。可能与https://github.com/axios/axios/issues/5336有关。
我不明白这个问题。所以我把'axios'改成'superagent',效果很好。