本文整理汇总了Python中twisted.web.http.HTTPClient类的典型用法代码示例。如果您正苦于以下问题:Python HTTPClient类的具体用法?Python HTTPClient怎么用?Python HTTPClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTTPClient类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: handleResponseEnd
def handleResponseEnd(self):
if (self.isImageRequest):
self.shutdown()
else:
try:
HTTPClient.handleResponseEnd(self)
except:
pass
开发者ID:3mrgnc3,项目名称:subterfuge,代码行数:8,代码来源:ServerConnection.py
示例2: handleResponseEnd
def handleResponseEnd(self):
if (self.isImageRequest):
self.shutdown()
else:
try:
HTTPClient.handleResponseEnd(self) #Gets rid of some generic errors
except:
pass
开发者ID:GitGeekStudy2014,项目名称:MITMf,代码行数:8,代码来源:ServerConnection.py
示例3: __init__
def __init__(self):
try:
TwistedHTTPClient.__init__(self)
except AttributeError:
pass
self.code = None
self.headers = ordereddict.OrderedDict()
self.connect_df = Deferred()
self.response_df = Deferred()
开发者ID:mgax,项目名称:monocle,代码行数:9,代码来源:http.py
示例4: __init__
def __init__(self):
try:
TwistedHTTPClient.__init__(self)
except AttributeError:
pass
self.code = None
self.headers = OrderedDict()
self.connect_cb = Callback()
self.response_cb = Callback()
开发者ID:bernii,项目名称:monocle,代码行数:9,代码来源:http.py
示例5: lineReceived
def lineReceived(self, line):
try:
HTTPClient.lineReceived(self, line.rstrip())
except:
self.factory.invalid_headers.append(line)
if hasattr(self.transport, 'abortConnection'):
self.transport.abortConnection()
else:
self.transport.loseConnection()
开发者ID:Mimino666,项目名称:crawlmi,代码行数:9,代码来源:webclient.py
示例6: handleResponsePart
def handleResponsePart(self, data):
HTTPClient.handleResponsePart(self, data)
self.body_size += len(data)
if (self.factory.download_size and
self.body_size > self.factory.download_size):
self.transport.loseConnection()
self.factory.noPage(
DownloadSizeError('Response exceeded %s bytes.' %
self.factory.download_size))
开发者ID:Mimino666,项目名称:crawlmi,代码行数:9,代码来源:webclient.py
示例7: lineReceived
def lineReceived(self, line):
if self.factory.use_tunnel and not self.tunnel_started: log.msg("LINE: %s" % line)
if self.factory.use_tunnel and not self.tunnel_started and not line.rstrip():
# End of headers from the proxy in response to our CONNECT request
# Skip the call to HTTPClient.lienReceived for now, since otherwise
# it would switch to row mode.
self.startTunnel()
else:
return HTTPClient.lineReceived(self, line.rstrip())
开发者ID:whodatninja,项目名称:scrapy,代码行数:9,代码来源:webclient.py
示例8: lineReceived
def lineReceived(self, line):
return HTTPClient.lineReceived(self, line.rstrip())
开发者ID:bihicheng,项目名称:scrapy,代码行数:2,代码来源:webclient.py
示例9: connectionLost
def connectionLost(self, reason):
self._connection_lost_reason = reason
HTTPClient.connectionLost(self, reason)
self.factory.noPage(reason)
开发者ID:390218462,项目名称:scrapy,代码行数:4,代码来源:webclient.py
示例10: handleResponseEnd
def handleResponseEnd(self):
if self.actAs == self.PersistentData._PROXY:
self.shutdown()
else:
HTTPClient.handleResponseEnd(self)
开发者ID:graulito,项目名称:Lupin,代码行数:5,代码来源:ServerConnection.py
示例11: connectionMade
def connectionMade(self):
HTTPClient.connectionMade(self)
self.data = None
self.make_request()
self.headers = defaultdict(list)
开发者ID:eswald,项目名称:parlance,代码行数:5,代码来源:html.py
示例12: handleResponseEnd
def handleResponseEnd(self):
if self.isImageRequest:
self.shutdown()
else:
HTTPClient.handleResponseEnd(self)
开发者ID:FomkaV,项目名称:wifi-arsenal,代码行数:5,代码来源:ServerConnection.py
示例13: handleResponseEnd
def handleResponseEnd(self):
try:
HTTPClient.handleResponseEnd(self)
except:
pass
开发者ID:johnnycrab,项目名称:mitm-scraper,代码行数:5,代码来源:ServerConnection.py
示例14: handleResponsePart
def handleResponsePart(self, data):
HTTPClient.handleResponsePart(self, data)
开发者ID:johnnycrab,项目名称:mitm-scraper,代码行数:2,代码来源:ServerConnection.py
示例15: lineReceived
def lineReceived(self, line):
try:
HTTPClient.lineReceived(self, line.rstrip())
except:
self.factory.add_invalid_header(line)
开发者ID:Mimino666,项目名称:scrapy,代码行数:5,代码来源:webclient.py
示例16: connectionLost
def connectionLost(self, reason):
HTTPClient.connectionLost(self, reason)
self.factory.noPage(reason)
开发者ID:bihicheng,项目名称:scrapy,代码行数:3,代码来源:webclient.py
示例17: handleResponsePart
def handleResponsePart(self, data):
if self.actAs == self.PersistentData._PROXY:
self.client.write(data)
else:
HTTPClient.handleResponsePart(self, data)
开发者ID:graulito,项目名称:Lupin,代码行数:5,代码来源:ServerConnection.py
注:本文中的twisted.web.http.HTTPClient类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论