Questions tagged [pushstreamcontent]

28 questions
22
votes
3 answers

how to download a zip file

I am trying to download a zip file from my web api controller. It is returning the file but I am getting a message the zipfile is invalid when i try to open. I have seen other posts about this and the response was adding the responseType:…
texas697
  • 4,171
  • 16
  • 56
  • 115
11
votes
2 answers

HttpClient and PushStreamContent

I use PushStreamContent with my REST API (ASP.NET Web API) and works great. The HttpClient can request a ressource and gets the HTTP-Response before the complete request is handled by the server (the server still writes to the push-stream). As…
user437899
  • 8,169
  • 12
  • 45
  • 69
9
votes
1 answer

PushStreamContent in asp.net 5 / mvc 6 is not working

Im trying to migrate a web api project (classic web.config project) there use PushStreamContent to the latest asp.net 5 web app (project.json). My problem is that i can not get PushStreamContent to work. When I use this api controller – a result…
rasmus-s
  • 91
  • 1
  • 2
9
votes
3 answers

ASP.NET Web API: PushStreamContent flush does not flush

I'm using PushStreamContent in ASP.NET Web API to push events from server to client (using Server-Sent Events). After each sent event, I call Flush on the Stream to push the buffered data to the client. However, I noticed that the flushing does not…
Tommy Carlier
  • 7,255
  • 3
  • 22
  • 42
6
votes
1 answer

PushStreamContent isn't sending the final zero-length chunk to signal the end of stream

I have a need to bulk-export content over WebAPI using the Odata protocol. We are trying to stream the results directly out of the database using PushStreamContent. When I run the service in my local IIS instance it works great, but when I push…
user60456
6
votes
1 answer

WebAPI PushStreamContent The remote host closed the connection

I am trying to use WebAPI within an MVC site to stream video with a PushStreamContent object. I have read several how tos on this (including this frequently cited post @ strathweb.com and still can't seem to get this working. Currently, the video…
5
votes
1 answer

WebApi PushStreamContent Error Handling

What's the proper way to handle errors when using Pushstreamcontent? I use Pushstreamcontent to stream data directly from database to a client. On the client I use HttpCompletionOption.ResponseHeadersRead when recieving the result. In the case the…
DanielG
  • 1,115
  • 1
  • 12
  • 32
4
votes
1 answer

Detecting client disconnect with PushStreamContent in Web API

Although HTTP is a stateless protocol, there's this PushStreamContent class that facilitates server-sent events, as you can read here. A Web API implementation may store client streams and periodically send push updates. However, it's a bit of a…
Gigi
  • 24,295
  • 20
  • 85
  • 170
3
votes
0 answers

Await Stream WriteAsync method is locking/freezing

I try stream audios with PushStreamContent and WebApi. For this I coded something. Main code; [HttpGet] public HttpResponseMessage StreamCall(long callId,int playSpeed) { var audio = new AudioStreamHelper(); var response =…
Stormcloak
  • 85
  • 2
  • 10
2
votes
1 answer

JSON object creation PushStreamContent

I have asp.net web api and has a HTTPResponseMessage and the api method name GetPersonDataStream, which actually stream each person object as a json. So when I see the result the actual Data has been constructed like two seperate object's with no…
Ramaswamy
  • 79
  • 1
  • 7
2
votes
1 answer

net::ERR_CONNECTION_RESET PushStreamContent

I´m trying to stream a video using PushStreamContent, but some seconds after the video starts playing the browser gives me a net::ERR_CONNECTION_RESET ( Error ) Frontend : using tag to call a webapi method that uses a action that sends a buffer…
brunof.89
  • 151
  • 1
  • 6
1
vote
0 answers

Is the Action passed to PushStreamContent guaranteed to be called?

The WebApi's PushStreamContent accepts an Action<> or a Func<> that is named "onStreamAvailable" and is supposed to be called when an output stream is available, allowing the action to write to it directly. Is that Action (or Func) guaranteed to…
GSerg
  • 71,102
  • 17
  • 141
  • 299
1
vote
1 answer

Send StringContent & StreamContent in the same post to server

i'd like to send string parameters and file to webserver. i have an error with streamContent This's my code using (var client = new HttpClient()) { using (var content = new MultipartFormDataContent()) { content.Add(new…
matoui
  • 21
  • 3
1
vote
1 answer

HttpResponse - how to set status code depends on PushStreamContent execution result

I write data to http response using PushStreamContent class. I need to retrieve an appropriate HTTP status code depends on result of onStreamAvailable delegate execution. Here is an example code: [HttpGet] public HttpResponseMessage Get(int id) { …
Dmitriy
  • 529
  • 2
  • 9
  • 24
1
vote
0 answers

Pushing zipFile using PushContentStream causes zip file to load rather than save

I am working with a c# web api controller, where my code is supposed to create several word documents and zip them into a zip file. I am using Ionic.Zip to zip the file and return it to the code below as the input parameter. The code is supposed to…
ddp3361
  • 11
  • 1
1
2