public function getHeadersString(\Psr\Http\Message\ResponseInterface $psr7response)
    {
        $strHeaders = '';
        if($psr7response === null)
        {
            return $strHeaders;
        }

        $arrHeaders = $psr7response->getHeaders();
        if (!is_array($arrHeaders) || count($arrHeaders) < 1) {
            return '';
        }

        foreach ($arrHeaders as $key => $value) {

            $strVal = '';
            if(is_array($value) && count($value)>0){
                $strVal = $value[0];

            }elseif (is_string($value)){
                $strVal = $value;
            }

            $strHeaders .= $key.':'.$strVal.PHP_EOL;
        }

        return $strHeaders;
    }
public function getHeadersString(\Psr\Http\Message\ResponseInterface $psr7response)
    {
        $strHeaders = '';
        if($psr7response === null)
        {
            return $strHeaders;
        }

        $arrHeaders = $psr7response->getHeaders();
        if (!is_array($arrHeaders) || count($arrHeaders) < 1) {
            return '';
        }

        foreach ($arrHeaders as $key => $value) {

            $strVal = '';
            if(is_array($value) && count($value)>0){
                $strVal = $value[0];

            }elseif (is_string($value)){
                $strVal = $value;
            }

            $strHeaders .= $key.':'.$strVal.PHP_EOL;
        }

        return $strHeaders;
    }
public function getHeadersString ( \ Psr \ Http \ Message \ ResponseInterface $ psr7response ) { $ strHeaders = '' ; if ( $ psr7response === null ) { return $ strHeaders ; } $ arrHeaders = $ psr7response -> getHeaders ( ) ; if ( ! is_array ( $ arrHeaders ) || count ( $ arrHeaders ) < 1 ) { return '' ; } foreach ( $ arrHeaders as $ key => $ value ) { $ strVal = '' ; if ( is_array ( $ value ) && count ( $ value ) > 0 ) { $ strVal = $ value [ 0 ] ; } elseif ( is_string ( $ value ) ) { $ strVal = $ value ; } $ strHeaders .= $ key . ':' . $ strVal . PHP_EOL ; } return $ strHeaders ; }
Get psr7 headers array and return string representation.
@param \Psr\Http\Message\ResponseInterface
@return string
Get psr7 headers array and return string representation .