Using the Requests python library in Google App Engine

前端 未结 3 1715
执念已碎
执念已碎 2020-12-08 07:37

I\'m trying to use the awesome Requests library on Google App Engine. I found a patch for urllib3, which requests relies on, that is compatible with App Engine. https://gith

3条回答
  •  时光取名叫无心
    2020-12-08 08:06

    On Google Appengine (version 1.9.18) requests version 2.3.0 (only!) works IN PRODUCTION (but not on SDK) if you have billing enabled, which enables sockets support.

    requests on the Appengine SDK fails with all https:// requests:

      ConnectionError: ('Connection aborted.', error(13, 'Permission denied'))
    

    requests version 2.4.1 fails with:

      File "distlib/requests/adapters.py", line 407, in send
        raise ConnectionError(err, request=request)
      ConnectionError: ('Connection aborted.', error(13, 'Permission denied'))
    

    requests version 2.5.1 fails with:

      File "distlib/requests/adapters.py", line 415, in send
        raise ConnectionError(err, request=request)
      ConnectionError: ('Connection aborted.', error(13, 'Permission denied'))
    

    Info on sockets support: https://cloud.google.com/appengine/docs/python/sockets/

    PS: Replace awsome with very-painful if you intend to use requests on GAE.

    See Also: Can Python Requests library be used on Google App Engine?

提交回复
热议问题