title: What is the Drupal 8 equivalent of Drupal 7's "drupal_add_html_head" within a module?
body: <p>I'm creating some custom modules for Drupal 8. They include some header modification for better Facebook integration. Here is what it looked like in Drupal 7 (SEVEN):</p>
  
  <pre><code>    $element1 = array
          (
          '#tag' =&gt; 'meta',
          '#attributes' =&gt; array
              ( 
              'property' =&gt; 'og:title',
              'content' =&gt; " Profile: " . $record-&gt;NameFirst . " " . $record-&gt;NameLast,
              ),
          );
      drupal_add_html_head($element1, 'og_title');
  </code></pre>
  
  <p>But this drupal_add_html_head function is long long gone in Drupal 8. And I'm quite lost as to where to START attacking this. Maybe it's "Headerbag"? There's a Headerbag::add. Maybe it's in the module's return variable, possibly adding another element somewhere here:</p>
  
  <pre><code>return array(
    '#markup' =&gt; t($pageContent),
  );
  </code></pre>
  
  <p>Maybe HtmlResponseAttachmentsProcessor::setHeaders? HeaderBag::set? Session::setRequestHeader? PoStreamWriter::setHeader? PoMetadataInterface::setHeader?</p>
  
  <p>Unfortunately, I can find pretty much no examples of how these are used. And I'm sure everyone here is familiar with the annoyance of having code that <em>does work</em> in previous versions that morphs into "doesn't work with no solution" in new code.</p>