curl post命令没有响应

curl post命令没有响应,curl,google-api,google-oauth,Curl,Google Api,Google Oauth,以下是YouTube上获取谷歌代币的教程 curl \ --request POST \ --data "code=[my_code]&client_id=[my_client_id]&client_secret=[my_client_secret]&redirect_uri=http://localhost&grant_type=authorization_code” \ https://accounts.google.com/o/oauth2/tok

以下是YouTube上获取谷歌代币的教程

curl \ --request POST \ --data "code=[my_code]&client_id=[my_client_id]&client_secret=[my_client_secret]&redirect_uri=http://localhost&grant_type=authorization_code” \ https://accounts.google.com/o/oauth2/token
按enter键将导致终端
,我想这表明它需要更多的输入


我需要添加/编辑什么才能获得访问/刷新令牌?

结束报价和开始报价不匹配,因此命令行仍然需要结束报价

使用下面的命令

curl \ --request POST \ --data "code=[my_code]&client_id=[my_client_id]&client_secret=[my_client_secret]&redirect_uri=http://localhost&grant_type=authorization_code" \ https://account
s.google.com/o/oauth2/token

不能与

收盘价和开盘价不匹配,因此命令行仍需要收盘价

使用下面的命令

curl \ --request POST \ --data "code=[my_code]&client_id=[my_client_id]&client_secret=[my_client_secret]&redirect_uri=http://localhost&grant_type=authorization_code" \ https://account
s.google.com/o/oauth2/token

不能与
一起使用”

这是我使用的代码,希望能有所帮助。基本的区别在于,对于重定向uri,您应该使用
&redirect\u uri=urn:ietf:wg:oauth:2.0:oob
,这将导致系统将代码返回到称为它的任何ip地址和文件

# Client id from Google Developer console
# Client Secret from Google Developer console
# Scope this is a space seprated list of the scopes of access you are requesting.

# Authorization link.  Place this in a browser and copy the code that is returned after you accept the scopes.
https://accounts.google.com/o/oauth2/auth?client_id=[Application Client Id]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=[Scopes]&response_type=code

# Exchange Authorization code for an access token and a refresh token.

curl \
--request POST \
--data "code=[Authentcation code from authorization link]&client_id=[Application Client Id]&client_secret=[Application Client Secret]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code" \
https://accounts.google.com/o/oauth2/token

# Exchange a refresh token for a new access token.
curl \
--request POST \
--data 'client_id=[Application Client Id]&client_secret=[Application Client Secret]&refresh_token=[Refresh token granted by second step]&grant_type=refresh_token' \
https://accounts.google.com/o/oauth2/token

这是我使用的代码,希望能有所帮助。基本的区别在于,对于重定向uri,您应该使用
&redirect\u uri=urn:ietf:wg:oauth:2.0:oob
,这将导致系统将代码返回到称为它的任何ip地址和文件

# Client id from Google Developer console
# Client Secret from Google Developer console
# Scope this is a space seprated list of the scopes of access you are requesting.

# Authorization link.  Place this in a browser and copy the code that is returned after you accept the scopes.
https://accounts.google.com/o/oauth2/auth?client_id=[Application Client Id]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=[Scopes]&response_type=code

# Exchange Authorization code for an access token and a refresh token.

curl \
--request POST \
--data "code=[Authentcation code from authorization link]&client_id=[Application Client Id]&client_secret=[Application Client Secret]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code" \
https://accounts.google.com/o/oauth2/token

# Exchange a refresh token for a new access token.
curl \
--request POST \
--data 'client_id=[Application Client Id]&client_secret=[Application Client Secret]&refresh_token=[Refresh token granted by second step]&grant_type=refresh_token' \
https://accounts.google.com/o/oauth2/token
代码从