Can anyone point me in the right direction or demonstrate how to make a request to Mashape using an API key without Unirest?
I hope to make a JSON request to a Mashape API simply using the HttpURLConnection class or perhaps Android REST libraries like OkHttp or Volley, but I cant figure out how to structure the request, or if it is even possible without using Mashape's Unirest library.
This is how they recommend to create Unirest requests:
HttpResponse<JsonNode> response = Unirest.get("https://wordsapiv1.p.mashape.com/words/incredible/definitions")
.header("X-Mashape-Key", "**********apikey************")
.header("Accept", "application/json")
.asJson();
Im trying to avoid Unirest because it seems like a pain to set up and because the great CommonsWare himself stated Unirest should be avoided for Android: Does anyone have an example of an android studio project that import Unirest via gradle?
I am actually trying to use the same api and with the same circumstances as Beginner in this question: Trying to fetch JSON with Android using Unirest