Can i use chunk size when i write to http stream ?

Dec 10, 2014 at 11:55 PM
I want to get progress information when i send binary data using http stream.

I found download example.
http://voidnish.wordpress.com/2013/05/15/casablanca-showing-progress-for-an-http-download/

This is snippet of my code
    auto iStream = std::make_shared<concurrency::streams::istream>();
    concurrency::streams::file_stream<uint8_t>::open_istream(FilePath.GetString())
    .then([=](concurrency::streams::istream inputStream )
{
    *iStream = inputStream;
})
    .then([=]()
{

http_client client(requestMsg.request_uri());
client.request(requestMsg.method(), L"", *iStream ).
         then([](pplx::task<http_response> responseTask)
{
    try 
    {
        http_response response = responseTask.get();

            }
     });

Please help me if this is possible : )
Coordinator
Dec 11, 2014 at 1:24 AM
Hi kisuya,

We have a feature in the library for reporting progress of an HTTP request and response. Take a look at the method http_request::set_progress_handler. It allows you to specify a callback to be execute as the headers and chunks of the request/response body are written and arrive. I think this will do exactly what you want.

Steve
Dec 16, 2014 at 6:13 AM
Hi steve,

I have completed my problem.
It was exactly what i want :)
Thanks to you.