Send web service request to bamboo to invoke plan from script runner listener inline script

amit January 16, 2019

I tried for :

 

def baseURL = "correct url since post man works " ;
def url = new java.net.URL(baseURL);
def requestMethod = "POST";
URLConnection connection = url.openConnection();

connection.setRequestProperty("Authorization", "Basic copied from postman, it is correct");

connection.setRequestMethod(requestMethod);

connection.setRequestProperty("Content-Type", "application/xml");

connection.setRequestProperty("Accept", "application/xml");

 

connection.connect();

 

For me: 

 

connection.setRequestMethod(requestMethod); 

gives me a problem saying that method: setRequestMethod could not be found.

 

I tried rest client as well, there exception gets raised but does not throw exact error

 

Kindly help for same.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events