Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3619

How do I use StreamedRequest in Dart http library to upload a file?

$
0
0

I want to upload a file via a non-multipart/form-data request like this:

POST http://127.0.0.1/uploadCache-Control: no-cache< /path/to/file/in/disk

(I tested and it successfully uploaded a file from JetBrain Rider's REST client to my REST endpoint.)

There is a StreamedRequest class in http package but I didn't find any constructor or setter to plug a byte stream or file content into it.

How do I use StreamedRequest to upload a file in Dart?


Viewing all articles
Browse latest Browse all 3619

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>