...
Code Block | ||
---|---|---|
| ||
HttpClient client = HttpClientBuilder.create().build(); HttpPost post = new HttpPost("https://jira.example.com/rest/"); String encoding = Base64.getEncoder().encodeToString((username.concat(":").concat(my-api-token)).getBytes("UTF-8")); post.setHeader(HttpHeaders.AUTHORIZATION, "Basic " + encoding); HttpResponse response = client.execute(post); |