【发布时间】:2021-10-26 08:30:59
【问题描述】:
我想知道如何使用 python 运行以下 cURL 请求(我在 Jupyter notebook 中工作):
curl -i -X GET "https://graph.facebook.com/{graph-api-version}/oauth/access_token?
grant_type=fb_exchange_token&
client_id={app-id}&
client_secret={app-secret}&
fb_exchange_token={your-access-token}"
我看到一些类似的问题和答案建议使用“requests.get”,但我是一个完整的 python 新手,不知道如何构造整个请求的语法,包括 id、secret 和 token 元素。任何帮助将不胜感激。
谢谢!
【问题讨论】:
-
这能回答你的问题吗? Execute curl command within a Python script
-
可以使用pycurl
-
stackoverflow.com/questions/26000336/… 检查这个问题,因为我发现它重复。