我正在尝试使用Unirest从https://www.wordsapi.com/中获取单词“ partOfSpeech”
HttpResponse<JsonNode> response =
Unirest.get("https://wordsapiv1.p.mashape.com/words/<ANY_WORD_HERE>/also")
.header("X-Mashape-Key", "<KEY_HERE>")
.header("X-Mashape-Host", "wordsapiv1.p.mashape.com")
.asJson();
gradle.app:
dependencies{
...
implementation 'com.mashape.unirest:unirest-java:1.4.9'
}
但是我遇到错误
java.lang.NoSuchFieldError: No static field INSTANCE of type
Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier
从WordsAPI获取单词的解决方案或替代方法是什么?
编辑: 找到了一种使用Volley的方法: Using Mashape APIs with Volley or HttpURLConnection
Unirest似乎无法在android studio中正常工作。