Listener recieving binary data on post

May 2, 2014 at 5:30 PM
Edited May 2, 2014 at 5:30 PM
I am in the process of writing a little listener service that recieves a binary file on a post. I see that http_request::body generates a concurrency stream that can be used to retrieve the values, but I am probably writing the code wrong, because I cannot get hold of the values.

Is there an example listener code that retrieves binary data?
May 5, 2014 at 5:07 PM
Using message.extract_vector().get(); gets the entire contents from the http_request type message.
Marked as answer by Nagendra17 on 5/5/2014 at 9:07 AM
May 5, 2014 at 5:33 PM
Hi Nagendra17,

Yes you can use extract_vector/extract_string/extract_json. You also can use http_request::body() to get access directly to the underlying stream. This can be helpful for streaming situations, when you want to start processing the data as soon as it arrives instead of waiting for the total body.