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

Connection refused when trying to send POST request

I use script-runner to send POST request in the server (http://localhost:5001), but I get "Connection refused". When i tried send it another( server it worked perfectly, but don't know why it doesn't work in this server? Maybe the problem in the port??? Any suggestions will be great. Here is my groovy script:


import org.apache.log4j.Logger
import org.apache.log4j.Level
import groovy.json.JsonSlurper;
import groovy.json.StreamingJsonBuilder;
import org.apache.commons.codec.binary.Base64;

def log = Logger.getLogger("com.acme.CreateSubtask")


def body_req = [
"command" : [
"gdp", "list", "test/p2"

//def baseURL = "";

def baseURL = "http://localhost:5001";

URL url;

url = new URL(baseURL);

HttpURLConnection connection = url.openConnection() as HttpURLConnection;
connection.requestMethod = "POST"
connection.doOutput = true
connection.setRequestProperty("Content-Type", "application/json")
connection.outputStream.withWriter("UTF-8") { new StreamingJsonBuilder(it, body_req) }
connection.connect();"json_body="+body_req+" URL="+url+" Status="+connection.getResponseCode() as String)

0 answers

Suggest an answer

Log in or Sign up to answer
Site Admin
Community showcase
Published in Marketplace Apps & Integrations

New Cloud Apps Roundup - Spring 2021

Atlassian's marketplace partners have had a very productive start to 2021! Since our last roundup, our developer community has added over 160 new cloud apps to the Atlassian Marketplace to help you...

84 views 1 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