title: Refreshing Spotify access_token
body: <p>I'm trying to use the refresh_token to (obviously) refresh the Spotify access_token I have. The documentation gives this as an example curl statement:</p>
  
  <p><code>curl -H "Authorization: Basic ZjM4Zj...Y0MzE=" -d grant_type=refresh_token -d refresh_token=NgAagA...NUm_SHo https://accounts.spotify.com/api/token</code></p>
  
  <p>and here is my Python implemtation:</p>
  
  <p><code>payload = {
      'grant_type': 'refresh_token',
      'refresh_token': &lt;REFRESH_TOKEN&gt;
  }
  r = requests.post('https://accounts.spotify.com/api/token', data=payload,
                          headers={'Authorization': 'Basic &lt;CLIENT_SECRET&gt;'})</code></p>
  
  <p>In both cases I get back <code>{"error":"invalid_client"}</code></p>
  
  <p>I've tried passing my client_id and the client_secret in the post data but I always get back invalid_client. Someone here on SO said I need to pass in code, but code is a single use, very short lived object that has already been consumed/expired.</p>
  
  <p>Any thoughts to what I'm doing wrong?</p>