当前位置: 首页>>代码示例>>Python>>正文


Python HTTPConnection.getresponse方法代码示例

本文整理汇总了Python中eventlet.green.httplib.HTTPConnection.getresponse方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPConnection.getresponse方法的具体用法?Python HTTPConnection.getresponse怎么用?Python HTTPConnection.getresponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eventlet.green.httplib.HTTPConnection的用法示例。


在下文中一共展示了HTTPConnection.getresponse方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getresponse

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import getresponse [as 别名]
 def getresponse(self):
     response = HTTPConnection.getresponse(self)
     logging.debug(("HTTP PERF: %(time).5f seconds to %(method)s "
                     "%(host)s:%(port)s %(path)s)"),
        {'time': time.time() - self._connected_time, 'method': self._method,
         'host': self.host, 'port': self.port, 'path': self._path})
     return response
开发者ID:AsherBond,项目名称:colony,代码行数:9,代码来源:bufferedhttp.py

示例2: GET

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import getresponse [as 别名]
 def GET(self, req):
     """Handle the query request."""
     conn = HTTPConnection('%s:%s' % (self.mds_ip, self.mds_port))
     headers = req.params
     conn.request('GET', req.path, headers=headers)
     resp = conn.getresponse()
     return Response(request=req, body=resp.read(), content_type=resp.getheader('Content-Type'))
开发者ID:2015-ucsc-hp,项目名称:swift,代码行数:9,代码来源:metadata.py

示例3: POST

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import getresponse [as 别名]
 def POST(self, env):
     """Handle posts dealing with metadata alteration"""
     req = Request(env)
     conn = HTTPConnection('%s:%s' % (self.mds_ip, self.mds_port))
     headers = req.params
     version, acc, con, obj = split_path(req.path, 1, 4, True)
     if not con:
         try:
             info = get_account_info(env, self.app)
             if info:
                 stor_policy = info['storage_policy']
                 headers['storage_policy'] = stor_policy
         except:
             pass
     else:
         try:
             info = get_container_info(env, self.app)
             if info:
                 stor_policy = info['storage_policy']
                 headers['storage_policy'] = stor_policy
         except:
             pass
     conn.request('POST', req.path, headers=headers)
     resp = conn.getresponse()
     #confirm response then pass along the request
     return self.app
开发者ID:2015-ucsc-hp,项目名称:swift,代码行数:28,代码来源:metadata.py

示例4: COPY

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import getresponse [as 别名]
 def COPY(self, env):
     """Eliminate metadata for deleted objects"""
     req = Request(env)
     conn = HTTPConnection('%s:%s' % (self.mds_ip, self.mds_port))
     headers = req.params
     conn.request('COPY', req.path, headers=headers)
     resp = conn.getresponse()
     #confirm response then pass along the request
     return self.app
开发者ID:2015-ucsc-hp,项目名称:swift,代码行数:11,代码来源:metadata.py

示例5: getresponse

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import getresponse [as 别名]
 def getresponse(self):
     response = HTTPConnection.getresponse(self)
     LOG.debug(
         "HTTP PERF: %(time).5f seconds to %(method)s " "%(host)s:%(port)s %(path)s)",
         {
             "time": time.time() - self._connected_time,
             "method": self._method,
             "host": self.host,
             "port": self.port,
             "path": self._path,
         },
     )
     return response
开发者ID:leochenliu,项目名称:keystone,代码行数:15,代码来源:bufferedhttp.py

示例6: sendData

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import getresponse [as 别名]
 def sendData(self, metaList, data_type, server_ip, server_port):
     ip = server_ip
     port = server_port
     updatedData = json.dumps(metaList)
     headers = {'user-agent': data_type}
     with ConnectionTimeout(self.conn_timeout):
         try:
             conn = HTTPConnection('%s:%s' % (ip, port))
             conn.request('PUT', '/', headers=headers, body=updatedData)
             resp = conn.getresponse()
             return resp
         except (Exception, Timeout):
             return HTTP_INTERNAL_SERVER_ERROR
开发者ID:2015-ucsc-hp,项目名称:swift,代码行数:15,代码来源:utils.py

示例7: PUT

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import getresponse [as 别名]
 def PUT(self, env):
     """Handle PUT requests related to metadata"""
     req = Request(env)
     conn = HTTPConnection('%s:%s' % (self.mds_ip, self.mds_port))
     headers = req.params
     try:
         info = get_container_info(env, self.app)
         if info:
             stor_policy = info['storage_policy']
             headers['storage_policy'] = stor_policy
     except:
         pass
     conn.request('PUT', req.path, headers=headers)
     resp = conn.getresponse()
     return self.app
开发者ID:2015-ucsc-hp,项目名称:swift,代码行数:17,代码来源:metadata.py

示例8: getresponse

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import getresponse [as 别名]
 def getresponse(self):
     response = HTTPConnection.getresponse(self)
     logging.debug('HTTP %s %s:%s %s',
                   self._method, self.host, self.port, self._path)
     return response
开发者ID:carriercomm,项目名称:oio-sds,代码行数:7,代码来源:http.py

示例9: getresponse

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import getresponse [as 别名]
 def getresponse(self):
     response = HTTPConnection.getresponse(self)
     logging.debug("HTTP PERF: %.5f seconds to %s %s:%s %s (%s)" %
             (time.time() - self._connected_time, self._method, self.host,
              self.port, self._path, self._txn_id))
     return response
开发者ID:github-lmp,项目名称:zft,代码行数:8,代码来源:bufferedhttp.py

示例10: getresponse

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import getresponse [as 别名]
 def getresponse(self):
     response = HTTPConnection.getresponse(self)
     
     return response
开发者ID:code-hunter,项目名称:mstore,代码行数:6,代码来源:bufferedhttp.py


注:本文中的eventlet.green.httplib.HTTPConnection.getresponse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。