这个 Clojurescript cljs-http 错误是什么意思?
What does this Clojurescript cljs-http error mean?
为了在 Clojurescript 中验证验证码,我正在使用 cljs-http,如下所示:
(def verify-url "https://www.google.com/recaptcha/api/siteverify")
;...
(http/post verify-url {:json-params {:secret key :response captcha-data}})
;...
...结果是:
{:status 0,
:success false,
:body "",
:headers {},
:trace-redirects ["https://www.google.com/recaptcha/api/siteverify"
"https://www.google.com/recaptcha/api/siteverify"],
:error-code :http-error,
:error-text " [0]"}
这是什么意思?
谢谢!
很可能您的预检 (OPTIONS) 请求失败了。检查您的开发者控制台是否有类似以下内容:
XMLHttpRequest cannot load
https://www.google.com/recaptcha/api/siteverify. Response to preflight
request doesn't pass access control check: No
'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://localhost:3449' is therefore not allowed
access. The response had HTTP status code 405.
为了在 Clojurescript 中验证验证码,我正在使用 cljs-http,如下所示:
(def verify-url "https://www.google.com/recaptcha/api/siteverify")
;...
(http/post verify-url {:json-params {:secret key :response captcha-data}})
;...
...结果是:
{:status 0,
:success false,
:body "",
:headers {},
:trace-redirects ["https://www.google.com/recaptcha/api/siteverify" "https://www.google.com/recaptcha/api/siteverify"],
:error-code :http-error,
:error-text " [0]"}
这是什么意思?
谢谢!
很可能您的预检 (OPTIONS) 请求失败了。检查您的开发者控制台是否有类似以下内容:
XMLHttpRequest cannot load https://www.google.com/recaptcha/api/siteverify. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3449' is therefore not allowed access. The response had HTTP status code 405.