📜  dart http 图片上传 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:47.137000             🧑  作者: Mango

代码示例1
var postUri = Uri.parse("apiUrl");

http.MultipartRequest request = new http.MultipartRequest("POST", postUri);

http.MultipartFile multipartFile = await http.MultipartFile.fromPath(
    'file', filePath); 

request.files.add(multipartFile);

http.StreamedResponse response = await request.send();


print(response.statusCode);