I want to get my header part as html and I will use this in some other site with API call. For that I am trying to render using
Magento\Theme\Block\Html\Header block and the following code:
$this->_view->getLayout() ->createBlock('Magento\Theme\Block\Html\Header') ->setTemplate('Magento_Theme::html/header.phtml') ->toHtml();
But it is not working. Can someone please suggest how to correct this or some other method to implement.