title: Angular2 Http Laravel CSRF Token
body: <p>Muddling through some Angular2 tutorials and trying to get a post request to work in Laravel 5.2   I have added this meta tag:</p>
  
  <pre><code>    &lt;meta name="csrf-token" content="{{ csrf_token() }}"&gt;
  </code></pre>
  
  <p>but I'm not sure how to pass that in the headers section or honestly if that is where it should go.</p>
  
  <pre><code>    let headers = new Headers({ 'Content-Type': 'application/json', 'X-CSRF-TOKEN': '???????' });
  </code></pre>
  
  <p>Update: So I added a function to pull the csrf-token from the meta tag but still have not found a way to get it passed to the Laravel post request.</p>
  
  <pre><code>    getToken() {
        let token = document.querySelector('meta[property="csrf-token"]')['content'];
        return token;
     }
  </code></pre>
  
  <p>Thanks</p>