yii\httpclient\CurlTransport::setHeaderOutput PHP Method

setHeaderOutput() private method

Setup a variable, which should collect the cURL response headers.
private setHeaderOutput ( resource $curlResource, array &$output )
$curlResource resource cURL resource.
$output array variable, which should collection headers.
    private function setHeaderOutput($curlResource, array &$output)
    {
        curl_setopt($curlResource, CURLOPT_HEADERFUNCTION, function ($resource, $headerString) use(&$output) {
            $header = trim($headerString, "\n\r");
            if (strlen($header) > 0) {
                $output[] = $header;
            }
            return mb_strlen($headerString, '8bit');
        });
    }