使用Google API Python客户库库的BOUND方法http请求http请求
我正在使用Python,以便使用Google API客户端Python库向YouTube数据API提出请求。我没有任何错误,但是每当我尝试打印出响应结果时,这种响应都会不断弹出:
<bound method HttpRequest.execute of <googleapiclient.http.HttpRequest object at 0x10af09ca0>>
这是我使用的代码:
from googleapiclient.discovery import build
api_key = '<my_api_key_redacted>'
youtube = build('youtube', 'v3', developerKey=api_key)
request = youtube.channels().list(part='statistics',forUsername='<my_user_id_redacted>')
response = request.execute
print(response)
如何解决此问题,以便我可以得到JSON结果而不是这个问题?
I am using Python in order to make a request to the Youtube Data API using the Google API Client Python Library. I don't get any errors, but this same response keeps popping up anytime I try to print out my response results:
<bound method HttpRequest.execute of <googleapiclient.http.HttpRequest object at 0x10af09ca0>>
This is the code I am using:
from googleapiclient.discovery import build
api_key = '<my_api_key_redacted>'
youtube = build('youtube', 'v3', developerKey=api_key)
request = youtube.channels().list(part='statistics',forUsername='<my_user_id_redacted>')
response = request.execute
print(response)
How do I fix this issue so I can get json results and not this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我犯了同样的错误,这是
.execute()
,您缺少第二行的括号。I made the same mistake, it's
.execute()
, you're missing the parentheses in the second to last line.