1
我試圖通過傳遞下面屏幕截圖中顯示的參數來獲取使用REST API的訪問令牌,但我面臨錯誤Required parameter is missing: grant_type
。我已經在Chrome瀏覽器中使用cURL和Advanced Rest API進行了嘗試。無法獲取Google OAuth 2.0訪問令牌
client_secret;xxx
refresh_token;
redirect_uri;https%3A%2F%2Fwww%2Eexample%2Ecom%2Foauth2callback
scope;https://www.googleapis.com/auth/drive
client_id;xxxxxxxx.apps.googleusercontent.com
access_token;
捲曲語法:
D:\>curl -k --header Content-Type=application/x-www-form-urlencoded -i -X POST "https://accounts.google.com/o/oauth2/token" -F 'code=4%2FdpbtMVUpzNFAfGHlxrNvfMlvHrPWk_m8y2I-thDdsLk.wvBSFgWEqW0Zcp7tdiljKKZFG-jOlgI' -F 'client_id=xxxxxxxx.apps.googleusercontent.com' -F 'client_secret=xxx' -F 'redirect_uri=https%3A%2F%2Fwww%2Eexample%2Ecom%2Foauth2callback' -F 'grant_type=authorization_code'
如何解決這個問題,我使用捲曲和先進的REST API發送這些參數?