1

Is it possible, using Grapevine, to create an endpoint that returns a stream, such as a video?

In WCF I would create a function with a return type of Stream. All Grapevine functions return IHttpContext. Can I use something like "HttpContext.Current.OutputStream"?

Alternatively, I see something in the code:

public sealed class AdvancedHttpResponse
{
    ...
    /// <summary>
    /// Gets a Stream object to which a response can be written
    /// </summary>
    public Stream OutputStream => _response.Response.OutputStream;
    ...
 }

How does one go about using this?

argyle
  • 1,319
  • 2
  • 14
  • 28
  • 1
    If you can stream with `HttpListener`, you can stream with Grapevine. As of 4.0, there is not built in implementation for it. You can, however, access the `OutputStream` from the `HttpResponseContext` using the property above, which is available to your route via `context.Response.Advanced.OutputStream`. – Scott Offen Dec 15 '16 at 16:59
  • 1
    This question might have the answers you are looking for, or put you on a track to finding an answer. http://stackoverflow.com/questions/8115422/httplistenerresponse-and-infinite-value-for-its-contentlength64-property – Scott Offen Dec 15 '16 at 18:08
  • Yes, very useful. Thank you. – argyle Dec 16 '16 at 17:21
  • Were you able to find an answer to your question? If so, I'd be interested in your implemented. Post it as an answer here? – Scott Offen Jan 18 '18 at 17:42

0 Answers0