且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

400发送HTTP发布请求以从身份验证代码获取令牌时出现错误请求?

更新时间:2022-03-19 05:17:47

我已经开始工作了.

I got this working.. i am sharing the code for those who are stuck with this:

$.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响应,但我根本没有响应

but now i have new issue. The url get 200 OK response but i am not getting response at all