1

我正在使用谷歌提供的 OAuth 游乐场。尽管我的调用中有 grant_type 参数,但它无法识别它。为了继续调用 API,我需要刷新我的令牌;但是,即使在操场上,通话也无法正常工作。

POST /o/oauth2/token?client_id=##########.apps.googleusercontent.com&client_secret=##########&refresh_token=##########-###########&grant_type=refresh_token 

HTTP/1.1
Host: accounts.google.com

Content-length: 0

Content-type: application/json

Authorization: Bearer ya29.1.AADtN_WMOMyvBKs_HomU60xaG1kJM2hUKFz1i7oVbCnGI-Bouk9VEqMDFJ1VbFA

HTTP/1.1 400 Bad Request

Alternate-protocol: 443:quic

Content-length: 102

X-xss-protection: 1; mode=block

X-content-type-options: nosniff

Content-disposition: attachment; filename="json.txt"; filename*=UTF-8''json.txt

Expires: Fri, 01 Jan 1990 00:00:00 GMT

X-google-cache-control: remote-fetch

Server: GSE

Via: HTTP/1.1 GWA

Pragma: no-cache

Cache-control: no-cache, no-store, max-age=0, must-revalidate

Date: Thu, 24 Apr 2014 19:16:45 GMT

X-frame-options: SAMEORIGIN

Content-type: application/json; charset=utf-8

-content-encoding: gzip

{

"error_description": "Required parameter is missing: grant_type", 

"error": "invalid_request"

}
4

0 回答 0