如何使用curl创建bitbucket存储库?

dev*_*ter 2 curl bitbucket bitbucket-api bitbucket-server

我尝试了多种方式

curl -you 'USERNAME' https://api.bitbucket.org/1.0/repositories -d '{"name":"REPO"}'
curl -k -X POST --user user: pass \ "https://api.bitbucket.org/1.0/repositories" -d "name=project_name"
Run Code Online (Sandbox Code Playgroud)

我想念什么?

dev*_*ter 6

没关系以下内容适用于Bitbucket 4.4版

curl -X POST -v -u $uservar:$passvar http://<redacted>/rest/api/1.0/projects/$projectkeyvar/repos -H "Content-Type: application/json" -d "{\"name\": \"$reponamevar\",\"scmId\": \"git\", \"forkable\": true }"
Run Code Online (Sandbox Code Playgroud)

我在shell脚本中使用了它,因此使用了变量。