Can I use Requests on Google App Engine? I think this library is perfect to create a REST client.
App Engine offers you a choice between two Python language environments.
What can Requests do? Requests will allow you to send HTTP/1.1 requests using Python. With it, you can add content like headers, form data, multipart files, and parameters via simple Python libraries. It also allows you to access the response data of Python in the same way.
Install the requests-toolbelt
library: https://github.com/sigmavirus24/requests-toolbelt
For App Engine it could be something like: pip install requests-toolbelt -t lib
(See: https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27#installing_a_library)
Then add:
from requests_toolbelt.adapters import appengine appengine.monkeypatch()
In your main.py
or equivalent.
Edit: this solution is now part of the official documentation: https://cloud.google.com/appengine/docs/python/issue-requests#issuing_an_http_request (in the REQUESTS
tab)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With