我可以使用 Requests在谷歌应用引擎上?我认为这个库非常适合创建 REST 客户端。
最佳答案
安装 requests-toolbelt
库:
https://github.com/sigmavirus24/requests-toolbelt
对于 App Engine,它可能类似于:pip install requests-toolbelt -t lib
(参见:https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27#installing_a_library)
然后添加:
from requests_toolbelt.adapters import appengine
appengine.monkeypatch()
在您的 main.py
或等效文件中。
编辑:这个解决方案现在是官方文档的一部分:https://cloud.google.com/appengine/docs/python/issue-requests#issuing_an_http_request
(在 REQUESTS
选项卡中)
关于python - 可以在 Google App Engine 上使用 Python Requests 库吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9604799/