def __init__(self, method=None, status=200, uri=None, raw_response=None): self.method = method self.uri = uri self.info = None self.request = None self.status = int(status) if isinstance(raw_response, text_type): self.raw_response = utf8(raw_response) else: self.raw_response = raw_response
def fill_filekind(self, fk): fk.write(utf8(self.raw_response)) fk.seek(0)