lithium\net\http\Response::_httpChunkedDecode PHP Method

_httpChunkedDecode() protected method

Decodes content bodies transferred with HTTP chunked encoding.
protected _httpChunkedDecode ( string $body ) : string
$body string A chunked HTTP message body.
return string Returns the value of `$body` with chunks decoded, but only if the value of the `Transfer-Encoding` header is set to `'chunked'`. Otherwise, returns `$body` unmodified.
    protected function _httpChunkedDecode($body)
    {
        if (stripos($this->headers('Transfer-Encoding'), 'chunked') === false) {
            return $body;
        }
        $stream = fopen('data://text/plain;base64,' . base64_encode($body), 'r');
        stream_filter_append($stream, 'dechunk');
        return trim(stream_get_contents($stream));
    }