title: vue-resource not passing token in request headers
body: <p>I'm new to Vuejs 2, currently using vue-resource to retrieve data from the server. However, I would need a token passed in the request header at the same time in order to retrieve the data from the server.</p>
  
  <p>So the problem is, I am unable to retrieve data because the token is not passed into the request header, using vue-resource.</p>
  
  <p>Here is the method that uses the vue-resource's interceptor (to pass in the token) to intercept the GET request:</p>
  
  <pre><code>test () {
    this.$http.interceptors.push((request) =&gt; {
      var accessToken = window.localStorage.getItem('access_token')
      request.headers.set('x-access-token', accessToken)
      return request
    })
    this.$http.get(staffUrl)
     .then(response =&gt; {
       console.log(response)
     }, (response) =&gt; {
       console.log(response)
     })
  }
  </code></pre>
  
  <p>Documentation for vue-resource, HTTP: <a href="https://github.com/pagekit/vue-resource/blob/develop/docs/http.md" rel="nofollow noreferrer">https://github.com/pagekit/vue-resource/blob/develop/docs/http.md</a></p>
  
  <p>When I try to GET the data, i end up with an error 403 (forbidden) and after checking the request headers in the dev tools, I also could not find the token in the request headers.</p>
  
  <p>Please tell me where I went wrong because I'm really new to this so i appreciate any help! Thank you!</p>