Hi everyone,
I am trying to make a GET call to Jira URL in Java using HttpURLConnection - getting 500 server error
If I make same call using postman - it works.
String url = "https://jira.mydomain.com/rest/raven/2.0/api/testrun/?testExecIssueKey=T22&testIssueKey=T2;
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
String basicAuth = "Basic :" + new String(Base64.getEncoder().encode(credentials.getBytes()));
con.setRequestProperty ("Authorization", basicAuth);
con.setRequestProperty("Content-Type", "application/json");
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
System.out.println(responseCode);
Can someone please help and see whats going wrong?