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 %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 body_text(req): return decompress(req.body, req.content_encoding)