By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,854 Members | 1,958 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,854 IT Pros & Developers. It's quick & easy.

Why "(500) Internal Server Error" throwed?

P: n/a
Hi,

When I am using the fowllowing code to open page
http://spaces.msn.com/members/mailcall/
....
try{
string url = http://spaces.msn.com/members/mailcall/;
HttpWebRequest httpReq = null;
HttpWebResponse httpResp = null;
httpReq = (HttpWebRequest)WebRequest.Create(url);
httpResp = (HttpWebResponse) httpReq.GetResponse();
}
catch(WebException ex)
{
....
}
....
I always got an WebException which says "The remote server returned an
error: (500) Internal Server Error". But actually if you open that page in
IE, it can be opened without any problem. How can I open this page in my
program and get the html source?

Any help would appreciate!

Andy
Feb 22 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
When I go to that address, IE redirects me to
http://spaces.msn.com/mailcall/. Have you tried connecting to that address
rather than the one you have been?

"Andy Chen" <pp****@hotmail.com> wrote in message
news:ei**************@TK2MSFTNGP14.phx.gbl...
Hi,

When I am using the fowllowing code to open page
http://spaces.msn.com/members/mailcall/
...
try{
string url = http://spaces.msn.com/members/mailcall/;
HttpWebRequest httpReq = null;
HttpWebResponse httpResp = null;
httpReq = (HttpWebRequest)WebRequest.Create(url);
httpResp = (HttpWebResponse) httpReq.GetResponse();
}
catch(WebException ex)
{
...
}
...
I always got an WebException which says "The remote server returned an
error: (500) Internal Server Error". But actually if you open that page in
IE, it can be opened without any problem. How can I open this page in my
program and get the html source?

Any help would appreciate!

Andy

Feb 22 '06 #2

P: n/a
Thus wrote Andy,
Hi,

When I am using the fowllowing code to open page
http://spaces.msn.com/members/mailcall/
...
try{
string url = http://spaces.msn.com/members/mailcall/;
HttpWebRequest httpReq = null;
HttpWebResponse httpResp = null;
httpReq = (HttpWebRequest)WebRequest.Create(url);
httpResp = (HttpWebResponse) httpReq.GetResponse();
}
catch(WebException ex)
{
...
}
...
I always got an WebException which says "The remote server returned an
error: (500) Internal Server Error". But actually if you open that
page in
IE, it can be opened without any problem. How can I open this page in
my
program and get the html source?
Any help would appreciate!


You don't send any HTTP header on which spaces.msn.com may rely on, like
User-Agent or Accept-Language. Try to send the same HTTP headers like a browser
(e.g. IE6) does. You can use tools like Fiddler to capture the HTTP traffic.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Feb 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.