Can some body explain me what happens ?
Wen i use this url code is working Label1 post remote page inside in my one
string url = "http://ireland.angloinfo.com/";
but this one not Label1 empty
string url = "http://cyprus.angloinfo.com/";
string html = string.Empty;
HttpWebRequest myHttpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
StreamReader myStreamReader = new StreamReader(myHttpWebResponse.GetResponseStream());
html = myStreamReader.ReadToEnd();
Label1.Text = html;
what went wrong ?
I’ve just checked, and your code returns a myhttpWebResponse with Status = “OK” and ContentLenght = 0, so everything was OK – it is just the server that returned no-data-at-all. The question is, why. Maybe you did not add some headers that are required by it?
I’ve just tried with setting:
and the page seems to download properly. BTW. Why don’t you use
WebClientclass instead? You’d have less problems in case of sessions and redirects..