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_request with custom stream

$
0
0
Hi kkostrzewa,

Maybe I'm missing something, but why can you only append to a file with approach 1? If you have to do base64 encoding as well then yes I see that this approach won't work.

The only examples we have of implementing a stream are in the actual product but there are several different ones. You can take a look at the following:

Producer Consumer (cpprest\producerconsumerstream.h): This is a memory-based stream buffer that supports both reading and writing a sequence of bytes. A single consumer and producer pair can communicate via the buffer from different threads.
File Streams (cpprest\filestream.h) : Supports input and output operations for files.
Container Streams (cpprest\containerstream.h): This is a stream that is backed by a basic STL container. It is a memory-based stream that supports both reading and writing.
Raw Pointer Streams (cpprest\rawptrstream.h) : A stream buffer that is based on a raw pointer and block size. The buffer cannot be expanded or contracted, it has a fixed capacity. This stream buffer class is used to create a memory backed stream that supports both reading and writing sequence of characters from a fixed block size.
Interop Streams (cpprest\interopstream.h) : Supports interop between STL iostreams or WinRT streams and Casablanca async streams.

For more examples of using streams you can take a look at some of the test cases located under Release\tests\Functional\streams.

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>