Flutter 将带有flatter的图像文件发布到nodejs后端

Flutter 将带有flatter的图像文件发布到nodejs后端,flutter,Flutter,我正在尝试将base64编码的映像发布到我的nodejs后端服务。但是,我遇到了以下错误: I/flatter(10367):类型“\u InternalLinkedHashMap”不是类型转换中“String”类型的子类型 我的json请求是: http.post(nodeEndPoint, body: { "id": { "image": idBase64Image, "name": idFileName, "descrip

我正在尝试将base64编码的映像发布到我的nodejs后端服务。但是,我遇到了以下错误:
I/flatter(10367):类型“\u InternalLinkedHashMap”不是类型转换中“String”类型的子类型

我的json请求是:

    http.post(nodeEndPoint, body: {
      "id": {
        "image": idBase64Image,
        "name": idFileName,
        "description": "ID File"
      },
      "pof": {
        "image": pofBase64Image,
        "name": pofFileName,
        "description": "Proof of Residence File"
      }
    }).then((res) {
       print(res.statusCode);
    }).catchError((err) {
      print(err);
    });

尝试创建如下所示的实体:

  Map data = {
    "id": {
      "image": idBase64Image, 
      "name": idFileName, 
      "description": "ID File"
    },
    "pof": {
      "image": pofBase64Image, // make sure this is string
      "name": pofFileName,
      "description": "Proof of Residence File"
    }
  };


//encode Map to JSON
var body = json.encode(data);

http.post(nodeEndPoint,
      headers: {"Content-Type": "application/json"},
      body: body
  ).then((res) {
       print(res.statusCode);
    }).catchError((err) {
      print(err);
    });