Hi,
Is this a firewall issue? if so what should I do to get around it?
Code
static async Task ConnectNative()
{
try
{
string apiUrl = @"https://website/rest/api/2/issue/Key-32";
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("GET"), apiUrl))
{
var base64authorization =
Convert.ToBase64String(Encoding.ASCII.GetBytes("EmailId:Token"));
request.Headers.TryAddWithoutValidation("Authorization", $"Basic {base64authorization}");
//Error Code
var response = await httpClient.SendAsync(request);
HttpContent requestContent = response.Content;
string jsonContent = requestContent.ReadAsStringAsync().Result;
}
}
}
catch (Exception ex)
{
throw;
}
}
Error details
+ ex {System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.