Receiving incomplete response from retrofit

后端 未结 1 423
广开言路
广开言路 2020-12-20 15:56

I am using retrofit version 2.6.1 for making http requests over the network. The JSON I am expecting is 42466 characters long. However, I am receiving only 4073

相关标签:
1条回答
  • 2020-12-20 16:23

    Eventually I figured out that why this is happening. There were no problem with the HTTP request. But only a part of it was being printed in logcat due to it's limited buffer size.

    There is a size limit of 1024 bytes for binary logs. The size limit for non-binary logs are as shown below.

    #define LOGGER_ENTRY_MAX_LEN        (4*1024)
    #define LOGGER_ENTRY_MAX_PAYLOAD (LOGGER_ENTRY_MAX_LEN - sizeof(struct logger_entry))
    

    To set the limit to a larger number, Preferences/Settings -> Editor -> General -> Console, check the box next to Override console cycle buffer size, and enter the number.

    I am feeling so embarrassed, but thank you for your support.

    0 讨论(0)
提交回复
热议问题