tarun janveja

tarun janveja

  • NA
  • 242
  • 37.9k

call http url in c # dot net

Jul 16 2017 1:41 PM
Hi,
 
i have below function for hitting 3 party url for every request in console application ,but aftter hitiing for 30-35 request below function works very slow .i have 5 lac request  every day due to slow responde after 30-35 request code works very slow ,how to fast the response. 3 party url is on public ip,there is no bandwidth problem and 3 party url,please help me
 
protected string getDirectUrl(string URL)
{
String strReply = "Success";
try
{
WebRequest request = WebRequest.Create(URL);

WebResponse response = request.GetResponse();

new StreamReader(response.GetResponseStream()).ReadToEnd();

response.Close();
}
catch (Exception ex)
{

this.WriteToFile("#Exception Message getDirectUrl# " + ex.Message);
return strReply;
}

return strReply;
 
 

Answers (1)