Wrap response in StringIO to be compatible with file API