Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HttpClient client = HttpClient.newHttpClient();
- HttpRequest request = HttpRequest.newBuilder()
- .uri(URI.create(NOTIFICATION_URL))
- .header("Content-Type", "application/json")
- .POST(ofString(mapper.writeValueAsString(notification)))
- .build();
- client.sendAsync(request, ofString())
- .thenApply(HttpResponse::body)
- .thenAccept(System.out::println)
- .join();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement