lixplor / android-Q-A

🐞 android related questions and answers
0 stars 0 forks source link

fastjson解析json为对象报错: syntax error, expect {, actual EOF, pos 0 #38

Closed lixplor closed 7 years ago

lixplor commented 7 years ago

fastjson解析json为对象报错: syntax error, expect {, actual EOF, pos 0

lixplor commented 7 years ago

原因: 解析的时候多次调用response.body().string() 解决: 调用一次response.body().string()将字符串获取到, 然后解析这个字符串为对象不会报错