Google App Engine上可以使用Python请求库吗? [英] Can Python Requests library be used on Google App Engine?

查看:228
本文介绍了Google App Engine上可以使用Python请求库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在Google App Engine上使用请求吗?我认为这个库是创建REST客户端的完美选择。 在Google Appengine(版本1.9.18)上请求 2.3.0版本适用于IN生产(但不在SDK上),如果您启用了计费功能,则支持套接字。 b
$ b

更新:截至2017年1月31日请求正在生产中使用版本2.9.1进行生产。但是,它不适用于Appengine SDK上的Google Cloud SDK 141.0.0 b
p

请求,并且所有https://请求均失败:

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

请求版本2.4.1在生产中失败:

 文件distlib /requests/adapters.py,第407行,发送
引发ConnectionError(err,request = request)
ConnectionError:('Connection aborted。',error(13,'Permission denied'))

请求版本2.5.1在制作中失败:

 文件distlib / requests / adapters.py,第415行,发送
raise ConnectionError(err,request = request)
ConnectionError :('Connection ',错误(13,'Permission denied'))

生产,但可能会导致Debian删除SSLv3支持t(请求2.3.0自带现在过时的urllib3)。作为解决方法,可以删除请求的urllib3副本源中包含PROTOCOL_SSLv3的行。

 'module'object has no attribute'PROTOCOL_SSLv3'

支持套接字的信息: https: //cloud.google.com/appengine/docs/python/sockets/


Can I use Requests on Google App Engine? I think this library is perfect to create a REST client.

解决方案

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

Update: As of 31 Jan 2017 Requests is working in production with version 2.9.1 in production. However, it's not working with Google cloud SDK 141.0.0

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

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

requests version 2.4.1 fails in production 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 in production with:

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

requests version 2.3.0 works in production, but may cause problems with Debians removed SSLv3 support in the SDK (requests 2.3.0 comes with its own now outdated urllib3). As workaround it is possible to delete the line containing PROTOCOL_SSLv3 in the source of request's urllib3 copy.

  'module' object has no attribute 'PROTOCOL_SSLv3'

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

这篇关于Google App Engine上可以使用Python请求库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆