title: Post request to Spotify API
body: <p>I'm using Node.js to build an website where I can skip tracks and queue songs in Spotify (project for learning nodeJS and Javascript) </p>
  
  <p>This code in inside index.html. </p>
  
  <pre><code>document.getElementById('skip-song').addEventListener('click', function(){
      $.post({
          url: 'https://api.spotify.com/v1/me/player/next',
          headers: {
              'Authorization': 'Bearer ' + access_token
          },
          success: function(response){
              console.log(response.headers);
          }
      });
  });
  </code></pre>
  
  <p>But, when I look on the console of the browser, it reads: </p>
  
  <blockquote>
    <p>Failed to load resource: the server responded with a status of 404 (Not Found) : 8888/[object%20Object]</p>
  </blockquote>
  
  <p>Question here is: should I be sending a request to the localhost and route it to spotify api or should I send a request directly to spotify like I'm doing in this code?</p>
  
  <p>If it's the second, I can't really figure out why it doesn't work. </p>