How to solve the problem that Android OkHttp3 can't get the complete json data?

A problem encountered in the recent project is that there is suddenly an interface data that cannot be parsed. If you look at it, the returned json data is missing, but what you can see with the network packet grabbing tool is complete. The lower layer of the network framework is based on okhttp3, and the returned data is obtained from the body of its Response, but no matter which way I use, I can not get it completely from the input stream of body, or directly body.string (), or body.bytes (). It is suspected that there are special encoded characters in the json data, which leads to a problem in parsing the whole length, but I can"t see it. If there is a child shoe god who has encountered similar problems, please help to answer, thank you.

Mar.22,2021

to trust the package grab tool, copy JSON, from the package grab software and use Chrome's JSON tool to check the data format.

it is suspected that there is a problem with the Chinese encoding in the json data. After asking the background, it is said that it is also encoded in UTF-8. My side of the acquisition is also encoded in UTF-8, but I still cannot read the complete json data. There is no solution at present. If you encounter anything, please let me know.

Menu