当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Unable to get the entire json response from the RestHandler

问题描述:

I am getting the list of all the available categories from a merchant site using their api.The response json string will give all the categories in a single response without page numbers..When I try to convert the json response string into a java object I get.

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected EOF at line 1 column 11

This is what I have done.

String jsonResponse = restHandler.executeAPI("taxonomy");

System.out.println(jsonResponse);

System.out.println(jsonResponse);

Gson gson = new Gson();

JsonParser parser = new JsonParser();

JsonArray jArray = parser.parse(jsonResponse).getAsJsonArray();

Can anyone tell me how to get all the categories in a single response .So that I will not get the above exception.

分享给朋友:
您可能感兴趣的文章:
随机阅读: