【发布时间】:2015-12-23 13:14:01
【问题描述】:
我想在 ruby 上使用 google url shortener。 我一直在使用googl。 在谷歌开发者控制台,我有一个 api 密钥。我已经设置了IP地址“127.0.0.1”。
然后,我写了如下,但是它返回了一个错误。 你能告诉我如何解决这个问题吗?
Googl.shorten('url',"127.0.0.1",my_api_key)
Googl::Error ({"error"=>{"errors"=>[{"domain"=>"usageLimits", "reason"=>"ipRefererBlocked", "message"=>"有一个 per-IP 或 在您的 API 密钥和请求上配置的 per-Referer 限制 不符合这些限制。请使用谷歌开发者 如果来自此 IP 的请求,则控制台更新您的 API 密钥配置 或应允许推荐人。", "extendedHelp"=>"https://console.developers.google.com"}], "code"=>403, "message"=>"有 per-IP 或 per-Referer 限制 在您的 API 密钥上配置并且请求与这些不匹配 限制。请使用 Google Developers Console 更新您的 如果来自此 IP 或引用者的请求应为 API 密钥配置 允许。"}}): app/controllers/products_controller.rb:102:in `create'
【问题讨论】:
标签: ruby-on-rails ruby google-url-shortener