I saw other questions, but thats not what i want, i dont want to upload an image to a server, i dont want to convert to base64...
I only want to post a file in a form data or something else and get the returned info.
i have this, but has not work:
void onTakePictureButtonPressed() {
takePicture().then((String filePath) {
if (mounted) {
setState(() {
imagePath = filePath;
videoController?.dispose();
videoController = null;
});
http.post('http://ip:8082/composer/predict', headers: {
"Content-type": "multipart/form-data",
}, body: {
"image": filePath,
}).then((response) {
print("Response status: ${response.statusCode}");
print("Response body: ${response.body}");
});
if (filePath != null) showInSnackBar('Picture saved to $filePath');
}
});
}