提问人:aldrien.h 提问时间:11/1/2023 最后编辑:aldrien.h 更新时间:11/1/2023 访问量:32
Google 网站验证返回错误“在您的网站上找不到必要的验证令牌”。
Google site verification returns error "The necessary verification token could not be found on your site."
问:
为什么即使页面包含必需的值,我也无法成功进行网站验证<meta>
<meta name="google-site-verification" content="example-here-wOdSNt90kex2PFg1TEtv_8" />
在 Rails 应用中使用以下使用的 gem 运行:
gem "google-api-client", "~> 0.53.0"
gem "omniauth-google-oauth2", "~> 1.1.1"
示例 API 请求和响应如下:
Sending HTTP post https://www.googleapis.com/siteVerification/v1/webResource?verificationMethod=META
400
#<HTTP::Message:0x00005632d9de41f0 @http_header=#<HTTP::Message::Headers:0x00005632d9de41c8
@http_version="1.1", @body_size=0, @chunked=false, @request_method="POST", @request_uri=#<Addressable::URI:0x2b196cef28dc URI:https://www.googleapis.com/siteVerification/v1/webResource?verificationMethod=META>, @request_query=nil, @request_absolute_uri=nil,
@status_code=400, @reason_phrase="Bad Request", @body_type=nil, @body_charset=nil,
@body_date=nil, @body_encoding=#<Encoding:UTF-8>, @is_request=false,
@header_item=[["Content-Type", "application/json; charset=UTF-8"], ["Vary", "Origin"], ["Vary", "X-Origin"],
["Vary", "Referer"], ["Content-Encoding", "gzip"], ["Date", "Wed, 01 Nov 2023 02:20:53 GMT"], ["Server", "ESF"], ["Cache-Control", "private"],
["X-XSS-Protection", "0"], ["X-Frame-Options", "SAMEORIGIN"], ["X-Content-Type-Options", "nosniff"], ["Alt-Svc", "h3= ":443 "; ma=2592000,h3-29= ":443 "; ma=2592000"], ["Transfer-Encoding", "chunked"]], @dumped=false>,
@peer_cert=#<OpenSSL::X509::Certificate: subject=#<OpenSSL::X509::Name CN=upload.video.google.com>,
issuer=#<OpenSSL::X509::Name CN=GTS CA 1C3,O=Google Trust Services LLC,C=US>, serial=#<OpenSSL::BN:0x00005632d9df09a0>, not_before=2023-10-09 08:10:33 UTC, not_after=2024-01-01 08:10:32 UTC>,
@http_body=#<HTTP::Message::Body:0x00005632d9de4128 @body="{ "error ": { "code ": 400, "message ": "The necessary verification token could not be found on your site. ", "errors ": [ { "message ": "The necessary verification token could not be found on your site. ", "domain ": "global ", "reason ": "badRequest " } ] }}", @size=0, @positions=nil, @chunk_size=nil>, @previous=nil>
答: 暂无答案
评论