Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: producer_consumer_buffer, large file and "multipart/form-data"

$
0
0
Hi denveloper,

There are a couple of different options. You could write to the producer_consumer_buffer in chunks. If you data is coming from a file the best thing probably would be to use a file buffer/file_stream. The steps basically consist of calling the factory function on the file_stream class, file_stream<uint8_t>::open_istream(filename). This function is asynchronous and returns a task of an input stream that you can then pass as the body of and http_request using the http_request::set_body(stream) method and set the Content-Type. Then what will happen is the stream will be read from in chunks, 64KB by default but configurable with http_client_config::set_chunksize, and sent out. The BingRequest sample uses a file buffer to save the HTTP response, instead for your case instead you will want to use the file buffer as the request body.

Steve

Viewing all articles
Browse latest Browse all 4845

Trending Articles



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