Bitbucket API 2 - create repository in a team project

前端 未结 1 1033
我在风中等你
我在风中等你 2021-02-09 08:01

I have a team on my bitbucket account, myteam, which contains a project named mainproject. Whenever I want to create a repository inside I only need to

1条回答
  •  北荒
    北荒 (楼主)
    2021-02-09 08:21

    The content type has to be specified to curl with this argument: -H "Content-Type: application/json". Then the json data would be accessed normally. So the final command would look like this:

    $ curl -X POST -v -u myaccount:passwd "https://api.bitbucket.org/2.0/repositories/myteam/repo2" -H "Content-Type: application/json"  -d '{"has_wiki": true, "is_private": true, "project": {"key": "PRJ_KEY"}}'
    

    0 讨论(0)
提交回复
热议问题