[英]Google-api-client asking for access token
My requirement is to get top 20 links for a search query in google.com. 我的要求是在google.com中获取搜索查询的前20个链接。 I am using the Google-api-client !
我正在使用Google-api-client ! for ruby.
红宝石。
Here goes the code I am using, 这是我正在使用的代码,
require 'google/api_client'
client = Google::APIClient.new
response = client.execute(
search.cse.list, 'key' => '<My Key>', 'cx' => '013036536707430787589%3A_pqjad5hr1a', 'alt' => 'json', 'q' => 'hello world'
)
Now I am facing three problems, 现在我面临三个问题,
Instead of setting a dummy access token, just set the authorization mechanism to nil: 无需设置虚拟访问令牌,只需将授权机制设置为nil即可:
client.authorization = nil
This way it won't send an authorization header and will just rely on the API key for identifying your app. 这样,它就不会发送授权标头,而只会依靠API密钥来识别您的应用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.