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
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
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
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
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
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
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