Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 如何使用oAuth令牌创建bitbucket回购?_Git_Curl_Oauth_Bitbucket - Fatal编程技术网

Git 如何使用oAuth令牌创建bitbucket回购?

Git 如何使用oAuth令牌创建bitbucket回购?,git,curl,oauth,bitbucket,Git,Curl,Oauth,Bitbucket,我正在尝试使用curl和从bitbucket收到的oAuth令牌创建一组bitbucket存储库。我对创建存储库的调用如下所示: curl -X POST -v -H "Authorization: Bearer 9gcHrIKxN(...)efRXD0-_9T-2qgGNtw" -H "Content-Type: application/json" \ https://api.bitbucket.org/2.0/repositories/FooBarQWD/test_create \

我正在尝试使用curl和从bitbucket收到的oAuth令牌创建一组bitbucket存储库。我对创建存储库的调用如下所示:

curl -X POST -v  -H "Authorization: Bearer 9gcHrIKxN(...)efRXD0-_9T-2qgGNtw"  -H "Content-Type: application/json"  \
  https://api.bitbucket.org/2.0/repositories/FooBarQWD/test_create \
  -d '{"scm": "git", "is_private": "true", "fork_policy": "no_public_forks" }'

标题说明如下:

我可以联系服务器,但得到响应

{"error": {"message": "Access token expired. Use your refresh token to obtain a new access token."}}
这听起来像是一个合理的错误消息,但如果我传递了错误的令牌字符串,我会收到相同的消息

如果我删除令牌的头条目并将其替换为
-u user:password
,我可以创建一个新的存储库,这样命令的其余部分就可以了


有人能给我一个提示吗?

我想我明白了。当我从收到的URL中复制令牌时,我省略了尾随的“%3D%3D”,它应该是令牌末尾的“==”。如果我附加“==”,则接受令牌并创建存储库


因此,似乎返回了错误的错误消息

是的,看起来我们可以改进那里的错误信息。谢谢你的回复!