title: How to add extra header to post request with vue-resource?
body: <p>I have a number of post requests in my app. Some of them have to have and extrace header with <code>token</code> I'm not sure how to append it</p>
  
  <p>So far my code is like this. I'm checking if there is a token and when append it to headers and after that I make post request with vue-resource post method.</p>
  
  <pre><code>let headers = new Headers({'Content-Type': 'application/json;charset=utf-8'});
  
   if(token !== '') {
      headers.append('TOKEN', token);
    }
  
    return this.http.post(uri, data, headers)
           .then(this.extractData)
           .catch(this.handleError);
  </code></pre>
  
  <p>But this doesn't append <code>TOKEN</code></p>
  
  <p>What does work is this</p>
  
  <pre><code>this.http.interceptors.push(function(request) {
                  request.headers.set('TOKEN', token);
              });
  </code></pre>
  
  <p>at the place of <code>headers.append('TOKEN', token);</code></p>
  
  <p>But for some reason it pushes <code>TOKEN</code> header not for certain requests but for all of them</p>
  
  <p>So when I'm make request with token - it works fine, after that I make request witthout token but it is still adds it.</p>
  
  <p>Anyone knows what is the best way to fix this?</p>
  
  <p><strong>UPD</strong> If I <code>console.log(headers.get('TOKEN'))</code> while doing <code>headers.append('TOKEN', token);</code> it gives me the right value. So my guess is that post request itself is called with wrong headers.</p>