多部分请求的响应解码未发生

时间:2019-07-12 12:22:47

标签: android api flutter http-post

在dart中,我在多部分请求中上传了Map中已命名图像的列表。在获取响应的同时,JSON即将破损。实际上,响应将自身分为两行,显示无法解码……

 [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: FormatException: Unterminated string (at character 1054)
E/flutter (24484): ...\/1**.***.*.***\/Q2\/console\/img\/show_image?dir=animak_image\/BK  <----


[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: FormatException: Unexpected character (at character 2)
E/flutter (24484): ----> 00004\/xHohpYaL9ZMKACJd.jpg&w=&h=100","medium":"http:\/\/1**.***.*.***\/Q2\..

在上面,...... dir = animak_image / BK 00004 / xHohpYaL9ZMKACJd.jpg ....此行分为两行

1 个答案:

答案 0 :(得分:0)

是的,这很简单.... stream是未来价值的必然选择。所以我确实等着流了.....就像...

 await request.send().then((value) async {
      if (response.statusCode == 200) {
        fetchedResponse = response;
      }
    });