Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.58 KB | None | 0 0
  1. String auth = "USER:PASS".bytes.encodeBase64().toString()
  2.  
  3. StringBuilder builder = new StringBuilder()
  4. builder.append("issueKey=").append(issue.key)
  5. query = builder.toString()
  6. URL url = new URL(REST_API_URL)
  7.  
  8. URLConnection connection = url.openConnection()
  9. connection.setRequestMethod("POST")
  10. connection.setDoOutput(true)
  11. connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
  12. connection.addRequestProperty("Authorization", "Basic "+auth)
  13. connection.outputStream.write(query.getBytes("UTF-8"))
  14. connection.connect()
  15. connection.getContent()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement