POST请求作为URL字符串?

时间:2014-03-11 21:09:59

标签: rest post oauth-2.0 google-api

如果我将它们作为字符串传递,我有一个可以执行POSTGET请求的应用程序。

我正在尝试点击一些Google API,但我在试图提出refresh_token POST请求时遇到困难。

谷歌想要的格式是:

POST /o/oauth2/token HTTP/1.1
Host: accounts.google.com
Content-Type: application/x-www-form-urlencoded

client_id={client_id}&
client_secret={client_secret}&
refresh_token=1/6BMfW9j53gdGImsiyUH5kU5RsR4zwI9lUVX-tqf8JXQ&
grant_type=refresh_token

我的问题是,如果client_idclient_secretrefresh_token是网址编码,我可以将此POST请求设为字符串吗?

像这样:

https://accounts.google.com/o/oauth2/token?client_id={client_id}&client_secret={secret}&refresh_token=1%26BMfW9j53gdGImsiyUH5kU5RsR4zwI9lUVX-tqf8JXQ&grant_type=refresh_token

0 个答案:

没有答案
相关问题