protected static function getBody(PsrResponse $response)
    {
        $stream = $response->getBody();
        if ($stream->getMetadata('wrapper_type') === 'plainfile') {
            return ['body' => '', 'file' => $stream->getMetadata('uri')];
        }
        if ($stream->getSize() === 0) {
            return ['body' => '', 'file' => false];
        }
        $stream->rewind();

        return ['body' => $stream->getContents(), 'file' => false];
    }