gpt4 book ai didi

google-oauth - 400 错误请求 - https ://accounts. google.com/o/oauth2/token

转载 作者:行者123 更新时间:2023-12-02 00:47:51 33 4
gpt4 key购买 nike

谁能告诉我为什么这是一个错误的请求

var searchurl = "https://accounts.google.com/o/oauth2/token";

$.ajax({
dataType: "json",
url:searchurl,
context: {code:auth_code, client_id:'clientid', client_secret:'secret', redirect_uri:'http%3A%2F%2Flocalhost:8085%2FGmailIntegration%2FgetAuthResponse.jsp', grant_type:'authorization_code'},
type:"POST",
contentType:"application/x-www-form-urlencoded",
success:function(data) {
alert(data);
},
error: function(jqXHR, exception) {
console.log(jqXHR);

}
});

最佳答案

我成功了..我正在为那些受此困扰的人分享代码:

$.ajax({
dataType: "json",
url:searchurl,
data: {code:code, client_id:'clientid', client_secret:'secret', redirect_uri:'http://localhost:8085/GmailIntegration/getAuthResponse.jsp', grant_type:'authorization_code'},
type:"POST",
contentType:"application/x-www-form-urlencoded; charset=utf-8",
crossDomain:true,
cache : true,
success:function(data) {
alert(data);
},
error: function(jqXHR, exception, errorstr) {
console.log(jqXHR);
alert(errorstr);
}
});

但现在我有新问题。该网址得到 200 OK 响应,但我根本没有得到响应

enter image description here

关于google-oauth - 400 错误请求 - https ://accounts. google.com/o/oauth2/token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20235380/

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