0

The json response for my api request is quite big(Content-Length: 6199). I am using volley for HTTP request. here is my code :

        final StringRequest req = new StringRequest(com.android.volley.Request.Method.POST, url,
            new com.android.volley.Response.Listener<String>() {
                @Override
                public void onResponse(String response) {

                    Log.d("DEBUG",response);

                    showOrHideProgressBar();

                }
            }, new com.android.volley.Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {

        }
    }) {
        @Override
        protected Map<String, String> getParams() {
            Map<String, String> params = new HashMap<String, String>();
            return params;
        }
    };

    req.setRetryPolicy(new DefaultRetryPolicy(60000,
            DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
    // TODO Auto-generated method stub
    AppController.getInstance().addToRequestQueue(req);

but unfortunately not full response is coming to my mobile end. Roughly 2/3 portion of the total response is coming which i can see from the logcat. Can anyone please tell me why only part of this response is coming while using volley request. I also give here the restApi link from which response is coming

http://173.254.242.246:8084/BGB/getPillarNames.jsp

Please tell me what i can do for this situation. THanks in advance.

1 Answers1

0

LogCat has a limit on how long individual lines might be. If the server response has 6000 characters this is well over the limit and will be truncated.

If you plan on logging the whole response you should break it up into chunks, as could be seen in this answer.

The data itself should be there, even if you can't log it.

Community
  • 1
  • 1
David Medenjak
  • 33,993
  • 14
  • 106
  • 134