首页 > 解决方案 > 有没有unirest java库的替代品?

问题描述

HttpResponse<JsonNode> response = Unirest.get("/rest/api/3/applicationrole")
                      .basicAuth("email@example.com", "<api_token>")
                      .header("Accept", "application/json")
                      .asJson();



                    System.out.println(response.getBody());

我正在尝试使用上面的代码连接到 jira 服务台实例,但即使在导入其依赖项后,unirest 导入也无法正常工作

<dependency>
    <groupId>com.mashape.unirest</groupId>
    <artifactId>unirest-java</artifactId>
    <version>1.4.9</version>
</dependency>

所以任何人都可以帮我解决上述问题

谢谢

标签: javaspring-bootjira-rest-apiunirest

解决方案


您必须使用完整的 url Unirest.get(" https://...../rest/api/3/applicationrole ")。

如果您正在访问 JIRA 企业,您可能还必须检查您是否在正确的网络中。


推荐阅读