Flutter 请求接口数据乱码怎么办?

2.2k 技术 , , 1 Comment

浏览器访问正常,但是在 Flutter 中拿到的却是一堆乱码,类似如下:

Java 如何创建多线程ï¼

原因是没有设置编码格式:

jsonObj = json.decode(response.body);

改用:

jsonObj = json.decode(utf8.decode(response.bodyBytes));

解决。

1 Comment

手动阀 says: Reply

http://garymeng.com/2879.html

你这网站很容易被爬呀

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *