示例#1
0
	def __str__(self):
		headers = ( k + ': ' + str(v) for k, v in self.headers.items() )
		txt = "%s %s %s\n\t{%s}" % (self.command, self.path, self.request_version, ', '.join(headers))
		if self.body:
			plain = decompress(self.body, self.content_encoding)
			txt += "\n" + str_(plain)
		return txt
示例#2
0
 def __str__(self):
     headers = (k + ': ' + str(v) for k, v in self.headers.items())
     txt = "%s\n\t{%s}" % (self.requestline, ', '.join(headers))
     if hasattr(self, 'body') and self.body:
         plain = decompress(self.body, self.content_encoding)
         txt += "\n" + str_(plain)
     return txt
示例#3
0
	def __str__(self):
		headers = ( k + ': ' + str(v) for k, v in self.headers.items() )
		txt = "%s\n\t{%s}" % (self.requestline, ', '.join(headers))
		if hasattr(self, 'body') and self.body:
			plain = decompress(self.body, self.content_encoding)
			txt += "\n" + str_(plain)
		return txt
示例#4
0
文件: dummy.py 项目: nomada2/KSP
 def __str__(self):
     t = "[DUMMY] %d %s (%d) %s" % (self.status, self.reason, self.length,
                                    self.headers)
     if self.body:
         if self.content_type is None \
           or self.content_type.startswith('text/') \
           or self.content_type.startswith('application/xml-') \
           or self.content_type == 'application/json':
             t += "\n" + str_(self.body)
         elif len(self.body) < 2048:
             t += "\n[HEX] " + str(binascii.hexlify(self.body), 'ascii')
     return t
示例#5
0
文件: dummy.py 项目: pwr/KSP
 def __str__(self):
     t = "[DUMMY] %d %s (%d) %s" % (self.status, self.reason, self.length, self.headers)
     if self.body:
         if (
             self.content_type is None
             or self.content_type.startswith("text/")
             or self.content_type.startswith("application/xml-")
             or self.content_type == "application/json"
         ):
             t += "\n" + str_(self.body)
         elif len(self.body) < 2048:
             t += "\n[HEX] " + str(binascii.hexlify(self.body), "ascii")
     return t
示例#6
0
文件: dummy.py 项目: intari/KSP
	def __str__(self):
		t = "[DUMMY] %d %s (%d) %s" % (self.status, self.reason, self.length, self.headers)
		if self.body:
			t += "\n" + str_(self.body)
		return t
示例#7
0
文件: dummy.py 项目: akleiw/KSP
	def __str__(self):
		t = "[DUMMY] %d %s (%d) %s" % (self.status, self.reason, self.length, self.headers)
		if self.body and (self.content_type is None or self.content_type.startswith('text/') or self.content_type.startswith('application/xml-')):
			t += "\n" + str_(self.body)
		return t