473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Why "(500) Internal Server Error" throwed?

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
2 7242
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sam | last post by:
Guys facing a strange problem any clue would really rescue me.. i am using a ASP application with following things Server : Intel Xeon (TM) CPU 2GHz, 2GB RAM, 136GB HDD OS : Windows 2000...
4
by: David Sworder | last post by:
Consider the following line of code (it's not important what it does): resp.DocItem=Relations.SelectDocItems_BySearchString(req.SearchPhrase); It turns out that this line is in error. The...
1
by: gerr | last post by:
Visual studio 2003 "HTTP/1.1 500 Internal Server Error" when trying to create a new Asp.net site with Visual Studio 2003 on localServer/IIS 5.1. Anyone have any new solutions or urls to point me...
1
by: gerr | last post by:
Visual studio 2003 "HTTP/1.1 500 Internal Server Error" when trying to create a new Asp.net site with Visual Studio 2003 on localServer XP Pro/IIS 5.1. Everything worked fine prior to installing...
1
by: phranque | last post by:
I am trying to create a webservice on VS.NET 2003 and I get this error. What gives?
2
by: Sosa | last post by:
Greetings, I have XP Pro and installed IIS 5.1. I tried to create a web service through VS.Net 2003 Pro. When I click the Open button, I get the above subject line error message. I've looked...
1
by: Tito Meinrath | last post by:
Hi, I'm really going mad about this! Currently I'm designing a student course on web services. Because I want them to understand what's really going on when web services correspond with each...
23
by: ticfranca | last post by:
Hi, I'm getting this error in the code below: sub Pega_recorde { $database = 'bundinha'; $host = 'localhost'; $usuario = 'myhumoradm'; $senha = 'my8xr2d2'; ...
1
by: bruce | last post by:
i'm getting the following error: mechanize._response.httperror_seek_wrapper: HTTP Error 500: i'm running python 5.1 and mechanize 0.1.7b I have no idea as to what I have to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.