title: How to send an image to an api in dart/flutter?
body: <p>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... </p>
  
  <p>I only want to post a file in a form data or something else and get the returned info.</p>
  
  <p>i have this, but has not work:</p>
  
  <pre><code>  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');
        }
      });
    }
  </code></pre>