protected function readStream()
    {
        if(!is_resource($this->stream)) {
            return '';
        }

        if(isset($headers['content-length'])) {
            $this->body = stream_get_contents($this->stream, $headers['content-length']);
        } else {
            $this->body = stream_get_contents($this->stream);
        }
        fclose($this->stream);
        $this->stream = null;
    }
protected function readStream()
    {
        if(!is_resource($this->stream)) {
            return '';
        }

        if(isset($headers['content-length'])) {
            $this->body = stream_get_contents($this->stream, $headers['content-length']);
        } else {
            $this->body = stream_get_contents($this->stream);
        }
        fclose($this->stream);
        $this->stream = null;
    }
protected function readStream ( ) { if ( ! is_resource ( $ this -> stream ) ) { return '' ; } if ( isset ( $ headers [ 'content-length' ] ) ) { $ this -> body = stream_get_contents ( $ this -> stream , $ headers [ 'content-length' ] ) ; } else { $ this -> body = stream_get_contents ( $ this -> stream ) ; } fclose ( $ this -> stream ) ; $ this -> stream = null ; }
Read stream content and return it as string

Function reads the remainder of the body from the stream and closes the stream.

@return string
Read stream content and return it as string