0

The JSON response looks something like this

[
  {
    "name": 0,
    "age": 0,
  }
]

I created a JSON object and tried to create a JSON array

JSONObject myjson = new JSONObject(res.asString());
JSONArray resArray = myjson.getJSONArray("");
JSONObject response2 = resArray.getJSONObject(0);
int actualPridId_int = ((ResponseBodyExtractionOptions) response2).jsonPath().get("name");

There is nothing between [ and { in the JSON response.

David Buck
  • 3,752
  • 35
  • 31
  • 35

0 Answers0