What is a C # StreamContent class?

This is probably due somewhere on the Internet, but I cannot find it. What is a StreamContent?

(I'm trying to understand C #, but I cannot correctly understand some examples of WebAPi, because I do not understand what StreamContent is.

A link that fully explains this (and not just a list of its properties, etc., such as MSDN) will be fine.

+3
source share
1 answer

This is an old post, but came across it, maybe it can help others: StreamContent- this is the type of content that you can use to set the property .Contentto HttpResponseMessage. This tells the web process that the content should be streamed from the source stream (read stream) to the client. For example, you can open FileStreamand pass it to the StreamContent constructor, and then set it to a property .Content. This will tell the server to read from FileStreamand pass the content down to the client, piece by piece. This is often preferable to reading the (potentially large) source stream (file) in ram and then returning the array (in this case, the web server should use RAM to store the file and transfer it to the client).

+7
source

All Articles