public function sendHeader(string $name, ?string $value): void
    {
        if (headers_sent($file, $line)) {
            throw new HttpException(sprintf("Cannot use '%s()', headers already sent in %s:%s",
                __method__, $file, $line));
        }

        // null means remove
        if ($value === null) {
            $this->removeHeader($name);
            header_remove($name);
        } else {
            $this->setHeader($name, $value);
            header(sprintf('%s: %s', $name, $value));
        }
    }
public function sendHeader(string $name, ?string $value): void
    {
        if (headers_sent($file, $line)) {
            throw new HttpException(sprintf("Cannot use '%s()', headers already sent in %s:%s",
                __method__, $file, $line));
        }

        // null means remove
        if ($value === null) {
            $this->removeHeader($name);
            header_remove($name);
        } else {
            $this->setHeader($name, $value);
            header(sprintf('%s: %s', $name, $value));
        }
    }
public function sendHeader ( string $ name , ? string $ value ) : void { if ( headers_sent ( $ file , $ line ) ) { throw new HttpException ( sprintf ( "Cannot use '%s()', headers already sent in %s:%s" , __method__ , $ file , $ line ) ) ; } // null means remove if ( $ value === null ) { $ this -> removeHeader ( $ name ) ; header_remove ( $ name ) ; } else { $ this -> setHeader ( $ name , $ value ) ; header ( sprintf ( '%s: %s' , $ name , $ value ) ) ; } }
Send header.
@param  string  $name
@param  ?string $value
@return void
@throws froq\http\HttpException
Send header .