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

New Post: http Range and reading the bytes out of the response body

$
0
0
Hi cosminonea,

To avoid the extra buffer copying, you can use the "set_response_stream" when you create the http request. When the response body data is ready, it will save to the stream buffer you provided.
 concurrency::streams::container_buffer<std::vector<uint8_t>> buf;
    msg.set_response_stream(buf.create_ostream());

    client.request(msg).then([](http_response response)
    {
        return response.content_ready();
    }).wait();

    auto result = buf.collection();

Viewing all articles
Browse latest Browse all 4845

Trending Articles



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