gpt4 book ai didi

javascript - 访问控制允许来源拒绝 spotify api

转载 作者:数据小太阳 更新时间:2023-10-29 05:48:00 25 4
gpt4 key购买 nike

<分区>

我正在尝试像这样访问 Spotify API token :

$.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);
},
});

但服务返回以下错误:

XMLHttpRequest cannot load https://accounts.spotify.com/api/token. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.bancadigital.com.br' is therefore not allowed access.

有人知道我如何访问该服务吗?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com