我正在嘗試像這樣訪問Spotify API令牌:$.ajax({ url: "https://accounts.spotify.com/api/token", type: 'POST', contentType: "application/json; charset=\"utf-8\"", crossDomain: true, data: { grant_type: "authorization_code", code: code, redirect_uri: "http://www.bancadigital.com.br/spotifyteste/callback.html" }, processData: false, dataType: "json", headers: { Authorization: "Basic " + utf8_to_b64(key) }, success: function( response ) { alert(response.access_token); },});但是該服務(wù)返回以下錯(cuò)誤:XMLHttpRequest無(wú)法加載https://accounts.spotify.com/api/token。所請(qǐng)求的資源上不存在“ Access-Control-Allow-Origin”標(biāo)頭。因此,不允許訪問來(lái)源“ http://www.bancadigital.com.br ”。有人知道我可以使用該服務(wù)嗎?
Access-Control-Allow-Origin拒絕Spotify api
紫衣仙女
2020-02-02 14:39:44