def METHOD_NAME(self, text):
    r = requests.get(self.ruri, allow_redirects=True)
    f = SpooledTempFileIOBase(mode="w" if text else "w+b")
    f.write(r.text if text else r.content)
    f.seek(0)  # go to beginning of file for reading
    return f