如何在JAVA中使用REST调用获取atlassian-stash项目上的分支列表



我发现stash提供了一个REST API来获取存储库中创建项目的详细信息。我是stash API的新手。请让我知道,我怎么能得到列表分支下的藏匿项目通过REST调用。

示例库项目路径

https://stash.test.local/projects/DEV/repos/central-project/browse

central-project包含多个分支,如

  1. 功能/测试
  2. 功能/test1

我想通过REST调用获得分支列表。

我终于找到了一个方法。对于REST调用,我在JAVA中使用REST -assured。

RestAssured.baseURI = "https://stash.test.local";
RestAssured.basePath = "/rest/api/1.0/projects/DEV/repos/central-project/branches";
RestAssured.authentication = RestAssured.preemptive().basic(
                    username, password);
Response response = RestAssured.get();
String branchJSON = response.asString();

相关内容

最新更新