OAuth with Spotify unable to get refresh token using curl OAuth with Spotify unable to get refresh token using curl curl curl

OAuth with Spotify unable to get refresh token using curl


The reason I was receiving a bad response is because I needed:

 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

After I inserted that line, I was able to acquire my tokens. Hopefully this is helpful.


The correct option to set header is CURLOPT_HTTPHEADER and unfortunately you are using CURLOPT_HEADER. That's why your authorization header is not set with curl request.

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);