java - 有没有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>
所以任何人都可以帮我解决上述问题
谢谢
解决方案
您必须使用完整的 url Unirest.get(" https://...../rest/api/3/applicationrole ")。
如果您正在访问 JIRA 企业,您可能还必须检查您是否在正确的网络中。
推荐阅读
- ruby-on-rails - 在rails中结合两种方法
- sql-server - “字符串或二进制数据将被截断”的解决方案
- java - 为什么 synchronized(ThreadB) ,ThreadB destroy 可以自动通知?
- docker - 1 out 5 fluentd 处于 ImagePullBackOff 状态
- php - 为 SAAS 客户组织 DNS 服务
- node.js - 我使用 create-react-app 创建了一个应用程序,但我无法通过“npm start”启动它
- c# - 枚举名称生成 nswag 和 swashbuckle
- prolog - 为什么不脱糖的“。” 列表的仿函数语法与 [] 的工作方式相同吗?
- javascript - 使用 addEventListener 时无法使用 GamepadEvent
- sql - 如何使用sql从两个表中获取数据