Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

HTTPBuilder POST with auth

Seems near impossible to make an authenticated request with HTTPBuilder.

Things I tried

http.auth.basic 'login', 'pass'
headers.'Authorization' = 
                "Basic ${"username:password".bytes.encodeBase64().toString()}"
http.setHeaders([Authorization: "Basic encodedAuthString="])

My code:

 def auth = "login:pass"
String authString = auth.bytes.encodeBase64().toString()
def http = new HTTPBuilder('')
http.setHeaders([Authorization: "Basic"+authString])
http.request( POST ) {
uri.path = '/path'
requestContentType = ContentType.JSON
body = someJson
response.success = { resp,reader ->
// ok

 None of the above worked for me. Request always results with 401 (Unauthorized)

0 answers

Suggest an answer

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

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

227 views 1 6
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