Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

C# The remote server returned an error: (407) Proxy Authentication Required.

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 ---

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Next level incident management in Jira Service Management

Hello Atlassian Community! We’re thrilled to announce some exciting changes to incident management in Jira Service Management Cloud, in order to give your teams extra muscle during incidents, and ...

1,603 views 20 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you