0

I am making a call to an API, the API returns fine in C# for another application but in Android for our APP it is cutting off after the 5534 character, for smaller sets of data it returns fine but after this it gets cutt off.. the string looks something like this:

response.getFirstHeader("X-JSON").getValue() is returning this

[{"Customer":"","Name":"Fred","MI":"","ContactType":"Person","Id":8909,"IsDeleted":false,"TotalClients":0},...."MANY MORE HERE"...
 ...{"Customer":"","Name":"Test Name","MI":"B","ContactType":"Person","Id"

I get all the lines fine up to the last one as you can see it cutts off by "Id". When I try with a smaller set, by calling the API to a smaller account, its fine.. it never gets cutt off and I obtain the expected results, on the other hand for this big account with a lot of data it just doesnt get everything..

Any idea of what could be the issue?

Related Code below:

        DefaultHttpClient client = HttpSingleton.getThreadSafeClient();
        HttpGet get = new HttpGet(URL);
        get.setHeader("Accept", "application/json");
        HttpResponse response = client.execute(get);
        get.abort();
        printHeaders(response);             
        responseString = response.getFirstHeader("X-JSON").getValue();
4

1 回答 1

0

您是否将数据作为 HTTP 标头传递?您可以在 HTTP 标头中传递的数据大小是有限制的。请参见:

http标头值的最大值?

为什么不像往常一样在响应正文中传递数据?

于 2013-07-05T23:48:18.640 回答