我无法使用okhttp获得完整的响应体

时间:2017-12-03 13:37:13

标签: java string okhttp3 okhttp

我无法从网址获得完整的正文:

        @Override
        public void onResponse(Call call, Response response) throws IOException {
            try (ResponseBody responseBody = response.body()) {
                if (!response.isSuccessful())
                    throw new IOException("Unexpected code " + response);
                Log.d("haha2","contents length: " + responseBody.contentLength());
                StringBuffer resultString = new StringBuffer(responseBody.string());
                Log.d("haha2", resultString.toString());

                callback.onResponse(resultString.toString());
            }
        }

我的源代码是

from <!DOCTYPE html> to </html>

我的期望是看到一个全尺寸的身体。例如,

  

export default addToCart = (item) => { console.log("item: " + item); return { type: 'ADD'. item }; }

但是,我只能看到身体的30%左右。

是因为java字符串大小?

0 个答案:

没有答案