F
Fredo
I'm using HttpWebRequest and HttpWebResponse to pull data from a web page.
Sometimes I don't get the complete content, but sometimes, even when this
happens, I get no exceptions either.
I thought I'd use the ContentLength property of the WebResponse to determine
if I've received all the data, but that always returns -1 (at least for the
pages I'm downloading).
What I'd like to do is re-queue the request if I don't get the complete
response, but I can't figure out how to be sure.
I do occasionally get WebExceptions for things like timeouts and other
problems, and I'm able to handle those fine. So I'm not sure why some of
these pages (maybe 1 in 30 or so) are coming back only partially. The site's
servers are heavily loaded which is why I don't always get the complete
response. If I load it up in a browser, I sometimes only get the partial
page as well, so browsers have the same problem, so I don't think it's my
code for reading the stream.
Thanks.
Fredo
Sometimes I don't get the complete content, but sometimes, even when this
happens, I get no exceptions either.
I thought I'd use the ContentLength property of the WebResponse to determine
if I've received all the data, but that always returns -1 (at least for the
pages I'm downloading).
What I'd like to do is re-queue the request if I don't get the complete
response, but I can't figure out how to be sure.
I do occasionally get WebExceptions for things like timeouts and other
problems, and I'm able to handle those fine. So I'm not sure why some of
these pages (maybe 1 in 30 or so) are coming back only partially. The site's
servers are heavily loaded which is why I don't always get the complete
response. If I load it up in a browser, I sometimes only get the partial
page as well, so browsers have the same problem, so I don't think it's my
code for reading the stream.
Thanks.
Fredo