Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
while calling url using httpwebrequest create(url) method i am getting error as

The remote server returned an error: (500) Internal Server Error

//Here is the code

string downloadurl=""http://Localhost:1005/Checker.mvc?lvl=s3cr3tkeySTX&user=ITB-Testing&company=ITBright&country=BE&warp=pu";
try
{

Uri url = new Uri(downloadurl);
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(url); //)System.Net.WebRequest.Create(url);
System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse();
response.Close();

}

What I have tried:

try
{
// string UrlForDownload = DownloadUrl;
Uri url = new Uri(downloadurl);
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(url); //)System.Net.WebRequest.Create(url);
System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse();
response.Close();

}

This above code i tried
Posted
Updated 12-Apr-16 1:47am
Comments
Suvabrata Roy 12-Apr-16 7:11am    
Did you hit that URL in IE and get the file? did you tried it...
Suvabrata Roy 12-Apr-16 7:11am    
Did you hit that URL in IE and get the file? did you tried it...
Member 11308970 12-Apr-16 7:55am    
This is window application
Suvabrata Roy 12-Apr-16 8:23am    
http://Localhost:1005/Checker.mvc?lvl=s3cr3tkeySTX&user=ITB-Testing&company=ITBright&country=BE&warp=pu
Suvabrata Roy 12-Apr-16 7:11am    
Did you hit that URL in IE and get the file? did you tried it...

1 solution

The 500 error means that the website code crashed. Either the code was badly written or the parameters you sent in the URL caused a condition in the code that was not anticipated or both.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900