Recaptcha 发送返回 401 的请求

问题描述 投票:0回答:1

我有验证码

<script src={`https://www.google.com/recaptcha/api.js?render=${MY_KEY}`}></script>

在我的应用程序中,它发送带有

pat?k=somenumbers
参数的请求,该请求始终返回 401。我的代码中没有
crossorigin= anonymous
。为什么会出现401?

javascript html recaptcha
1个回答
0
投票

我认为它不起作用并返回 401,因为您错误地实现了它。 这是如何添加验证码的示例:

<html>
  <head>
    <title>reCAPTCHA demo: Simple page</title>
    <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  </head>
  <body>
    <form action="?" method="POST">
      <div class="g-recaptcha" data-sitekey="your_site_key"></div>
      <br/>
      <input type="submit" value="Submit">
    </form>
  </body>
</html>

您还可以阅读文档以了解更多信息。

© www.soinside.com 2019 - 2024. All rights reserved.