Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. HttpClient client = HttpClient.newHttpClient();
  2. HttpRequest request = HttpRequest.newBuilder()
  3. .uri(URI.create(NOTIFICATION_URL))
  4. .header("Content-Type", "application/json")
  5. .POST(ofString(mapper.writeValueAsString(notification)))
  6. .build();
  7. client.sendAsync(request, ofString())
  8. .thenApply(HttpResponse::body)
  9. .thenAccept(System.out::println)
  10. .join();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement