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


Python HTTPConnection.putrequest方法代码示例

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


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

示例1: http_connect

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import putrequest [as 别名]
def http_connect(host, method, path, headers=None):
    conn = HTTPConnection(host)
    conn.path = path
    conn.putrequest(method, path)
    if headers:
        for header, value in headers.iteritems():
            conn.putheader(header, str(value))
    conn.endheaders()
    return conn
开发者ID:fvennetier,项目名称:oiopy,代码行数:11,代码来源:http.py

示例2: http_connect

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import putrequest [as 别名]
def http_connect(host, method, path, headers=None):
    conn = HTTPConnection(host)
    conn.path = path
    conn.putrequest(method, path)
    if headers:
        for header, value in headers.items():
            if isinstance(value, (list, tuple)):
                for k in value:
                    conn.putheader(header, str(k))
            else:
                conn.putheader(header, str(value))
    conn.endheaders()
    return conn
开发者ID:carriercomm,项目名称:oiopy,代码行数:15,代码来源:http.py

示例3: putrequest

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import putrequest [as 别名]
    def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0):
        '''Send a request to the server.

        :param method: specifies an HTTP request method, e.g. 'GET'.
        :param url: specifies the object being requested, e.g. '/index.html'.
        :param skip_host: if True does not add automatically a 'Host:' header
        :param skip_accept_encoding: if True does not add automatically an
           'Accept-Encoding:' header
        '''
        self._method = method
        self._path = url
        return HTTPConnection.putrequest(self, method, url, skip_host,
                                         skip_accept_encoding)
开发者ID:openstack,项目名称:swift,代码行数:15,代码来源:bufferedhttp.py

示例4: putrequest

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import putrequest [as 别名]
 def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0):
     self._method = method
     self._path = url
     return HTTPConnection.putrequest(self, method, url, skip_host,
                                      skip_accept_encoding)
开发者ID:AsherBond,项目名称:colony,代码行数:7,代码来源:bufferedhttp.py

示例5: putrequest

# 需要导入模块: from eventlet.green.httplib import HTTPConnection [as 别名]
# 或者: from eventlet.green.httplib.HTTPConnection import putrequest [as 别名]
 def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0):
     self._method = method  # save method for getexpect method
     return BaseHTTPConnection.putrequest(self, method, url, skip_host,
                                          skip_accept_encoding)
开发者ID:Nexenta,项目名称:python-nostclient,代码行数:6,代码来源:http.py


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