influx.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:weewx-influx 作者: matthewwall 项目源码 文件源码
def post_request(self, request, payload=None):
        # FIXME: provide full set of ssl options instead of this hack
        if self.server_url.startswith('https'):
            import ssl
            return urllib2.urlopen(request, data=payload, timeout=self.timeout,
                                   context=ssl._create_unverified_context())
        return urllib2.urlopen(request, data=payload, timeout=self.timeout)

#    def post_request(self, request, payload=None):  # @UnusedVariable
#        try:
#            try:
#                _response = urllib2.urlopen(request, timeout=self.timeout)
#            except TypeError:
#                _response = urllib2.urlopen(request)
#        except urllib2.HTTPError, e:
#            logerr("post failed: %s" % e)
#            raise weewx.restx.FailedPost(e)
#        else:
#            return _response
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号