I use a web service for image processing , it works well in Postman:
Now I want to make http request in flutter with Dart:
import \'pa
There is a static method in MultipartFile class which will be helpful called, fromPath which returns Future. You can add the file in your request body using request.files.add() method.
final postUri = Uri.parse(kAPIUrl);
http.MultipartRequest request = http.MultipartRequest('POST', postUri);
http.MultipartFile multipartFile =
await http.MultipartFile.fromPath('image_file', filePath); //returns a Future
request.files.add(multipartFile);
http.StreamedResponse response = await request.send();