HTTP/2帧层中的流错误-R脚本中的Spotify API

HTTP/2帧层中的流错误-R脚本中的Spotify API,r,api,curl,spotify,R,Api,Curl,Spotify,我正试图通过API从Spotify获取数据。例如,获取需要授权的曲目({id})的音频功能 查询示例如下: search_query <- "https://api.spotify.com/v1/audio-features/6pnwfWyaWjQiHCKTiZLItr" fromJSON(search_query, flatten = TRUE) 所以fromJSON()从一开始就表示错误401。如何避免这种情况 spotifyKey <- "xxxxxxxxxxxxxxxxxx

我正试图通过API从Spotify获取数据。例如,获取需要授权的曲目({id})的音频功能

查询示例如下:

search_query <- "https://api.spotify.com/v1/audio-features/6pnwfWyaWjQiHCKTiZLItr"
fromJSON(search_query, flatten = TRUE)
所以fromJSON()从一开始就表示错误401。如何避免这种情况

spotifyKey <- "xxxxxxxxxxxxxxxxxxxx"
spotifySecret <- "zzzzzzzzzzzzzzzzzzzzzz"
spotifyEndpoint <- oauth_endpoint(NULL, "https://accounts.spotify.com/authorize", "https://accounts.spotify.com/api/token")
spotifyApp <- oauth_app("spotify", spotifyKey, spotifySecret)
spotifyToken <- oauth2.0_token(spotifyEndpoint, spotifyApp)
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
Error in curl::curl_fetch_memory(url, handle = handle) :
  Stream error in the HTTP/2 framing layer