在Fantom中向OAuth 2.0发出POST请求

时间:2014-12-02 23:52:53

标签: rest oauth-2.0 fantom

这个简单的POST请求我遇到了很多麻烦。这是我的代码:

monGoose := WebClient(`https://accounts.google.com/o/oauth2/token/`)
monGoose.postForm(["code":mongoosetoken_string, "redirect_uri":redirect_string, "client_id":client_id_string, "client_secret":client_secret_string, "scope":"", "grant_type":"authorization_code"])
echo(monGoose.resStr)

它只是向https://accounts.google.com/o/oauth2/token/设置了一个网络请求,然后根据OAuth 2.0规范发布其他数据。但是,这仍然没有任何用处,只有404代码。任何提示或指示?我做错了什么令人难以置信的明显?对不起,如果它太模糊,我只是非常迷失。

1 个答案:

答案 0 :(得分:0)

我修好了!它必须是

https://accounts.google.com/o/oauth2/token 

不是

https://accounts.google.com/o/oauth2/token/