Hi Team,
I am unable to connect to JIRA Rest API using a web application , but when I use the same code inside a console application, I am able to connect. Please help me resolve this issue.
I am recieving the error below when trying to connect from a web application-:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Please help me resolve this issue
I am using the code shown below-:
using (WebClient wc = new WebClient())
{
wc.Headers.Add("Authorization", "Basic " + GetEncodedCredentials());
tasks = wc.DownloadString("MyCompanyjiraURLusingJQL"));
}
string GetEncodedCredentials()
{
string mergedCredentials = string.Format("{0}:{1}", "UserName", "Password");
byte[] byteCredentials = UTF8Encoding.UTF8.GetBytes(mergedCredentials);
return Convert.ToBase64String(byteCredentials);
}
I think the code should work fine , as it is working for the console application and not for the web application.