如何解决在Dropbox中使用javascript提取请求无法获取访问令牌
我尝试通过以下方式使用javascript提取访问令牌:
map_dfr(names(iris)[1:2],~ tidy(lm(reformulate('Species',response = .x),data = iris)))
# A tibble: 6 x 5
# term estimate std.error statistic p.value
# <chr> <dbl> <dbl> <dbl> <dbl>
#1 (Intercept) 5.01 0.0728 68.8 1.13e-113
#2 Speciesversicolor 0.93 0.103 9.03 8.77e- 16
#3 Speciesvirginica 1.58 0.103 15.4 2.21e- 32
#4 (Intercept) 3.43 0.0480 71.4 5.71e-116
#5 Speciesversicolor -0.658 0.0679 -9.69 1.83e- 17
#6 Speciesvirginica -0.454 0.0679 -6.68 4.54e- 10
成功从重定向后,我收到AUTHORIZATION_CODE “ https://www.dropbox.com/oauth2/authorize ...”域。
但是我有一个错误
fetch('https://api.dropboxapi.com/oauth2/token',{
method: 'POST',code: AUTHORIZATION_CODE,grant_type: 'authorization_code',redirect_uri: `${REDIRECT_URI}${window.location.pathname}`,headers: {
'Content-Type': "application/x-www-form-urlencoded"
},CLIENT_ID: CLIENT_SECRET
})
.then(res => res.json())
.then(data => console.log('access data =>',data))
.catch(err => console.log('access err =>',err));
我在做什么错?因为我从这里遵循curl请求示例: https://www.dropbox.com/developers/documentation/http/documentation#oauth2-token
{"error_description": "No auth function available for given request","error": "invalid_request"}
谢谢!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。