使用抖动发布图像

时间:2020-06-25 04:33:11

标签: flutter http-post image-upload

我有一些通过Flutter使用POST和GET到服务器获取JSON的经验,但是这个文件业务让我感到困惑。

服务器代码具有以下命令行结构格式:

curl --location --request POST 'URIaddress' \
--form 'data_id=001' \
--form 'image=@/file.jpg'

而且我无法想象这与我所看到的其他多段流上传如何兼容。

该文件是Flutter的image_picker(_image)中jpg的临时文件路径和文件名。

如果我打电话:

var val = API.updateImage(sampleID:sampleId),file: _image);

API的将来会是什么样(带有一些返回值)?

static Future updateImage({sampleID, file}) async {...return val;}

先感谢帮助!

0 个答案:

没有答案