I have an HTTP GET request to an API and I receive a JSON response as a string. However, this JSON is given as part of an array:
[
{
"test": "something",
"another": "else"
},
]
This response is what is provided but in a string format. Is there a way to find the first element of the array and then parse the JSON?
Code:
OkHttpClient http = j.getHttpClient();
Request request = new Request.Builder().url(url)
.addHeader("key", "<key>")
.build();
Response response = http.newCall(request).execute();