c# - get every response in Http Get -
i using webclient , post requests. when send http request get
info this:
webclient client = new webclient(); client.downloadstringasync(new uri(requesturi), "get");
i can receive info 1min totally. can receive info in 20 seconds , other in 30 seconds , after completion of 1min. know whenever receive data. have event in web client bytes of info receive.. can 1 please help me find solution.
the webclient.downloadprogresschanged
event gets raised whenever 1 of async methods receives data. however, there no way determine info has been read doesn't sound solve problem.
if need total command on request have abandon webclient
, work straight lower-level webrequest
class. specifically, want send webrequest
in order webresponse
, phone call getresponsestream
on it; returned stream exposes async functionality lets whatever need. downside of course of study have orchestrate manually, going much more 2 lines of code.
there illustration of how on msdn docs webrequest.begingetresponse
.
c# .net http webclient
No comments:
Post a Comment