Response status code does not indicate success: 403 (Forbidden).


I have try to add new componet to particula project using the below c# console application,

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http;
using System.Json;
using System.Runtime.Serialization;
using System.Web.Script.Serialization;
using Newtonsoft.Json;

namespace ConsoleApplication1
class Program
static void Main(string[] args)
string data = @"{""name"":""xxxxxx"",""project"":""yyyyyyyy""}";
string output;
HttpClientHandler newClientHandler = new HttpClientHandler();
System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
client.DefaultRequestHeaders.ExpectContinue = false;
client.Timeout = TimeSpan.FromMinutes(90);
byte[] crdential = UTF8Encoding.UTF8.GetBytes("adminName:adminPassword");
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(crdential));
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
System.Net.Http.HttpContent content = new StringContent(data, Encoding.UTF8, "application/json");
client.PostAsync("", content).ContinueWith(requesTask =>
var response = requesTask.Result;
response.Content.ReadAsStringAsync().ContinueWith(readTask =>
var out1 = readTask.Result;
Console.WriteLine("Response Result :" + out1);


catch (Exception exc)

when i run the application response status is below,

Response status code does not indicate success: 403 (Forbidden).

but i replace the uri like http://localhost:8080/rest/api/2/component it add the comoponent to the particular project.

How to solve this issue?

1 answer


When i put break point in the response.EnsureSuccessStatusCode() , i find the below message,

+ result1 {StatusCode: 403, ReasonPhrase: 'Forbidden', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
Connection: keep-alive
X-AREQUESTID: 71x300x2
X-Content-Type-Options: nosniff
X-Authentication-Denied-Reason: CAPTCHA_CHALLENGE; login-url=
Vary: Accept-Encoding
Date: Mon, 29 Apr 2013 05:11:15 GMT
Set-Cookie: JSESSIONID=E75D1F5D6880844BF2698617B5EEC360; Path=/; HttpOnly
Server: nginx
WWW-Authenticate: OAuth realm=""
Content-Length: 4350
Content-Type: text/html; charset=UTF-8
}} System.Net.Http.HttpResponseMessage

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

167 views 1 17
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you