content: package org.alx.article._48_java_rest_clients.native_client;
  
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.http.HttpRequest.BodyPublishers;
  import java.util.concurrent.CompletableFuture;
  
  public class AsyncPostRequest {
      public static void main(String[] args) {
          // Create an HttpClient instance
          HttpClient client = HttpClient.newHttpClient();
  
          // Create a HttpRequest
          HttpRequest request = HttpRequest.newBuilder()
                  .uri(URI.create("https://jsonplaceholder.typicode.com/posts"))
                  .header("Content-Type", "application/json")
                  .POST(BodyPublishers.ofString("{\"title\":\"foo\",\"body\":\"bar\",\"userId\":1}"))
                  .build();
  
          // Send the request asynchronously
          CompletableFuture<HttpResponse<String>> responseFuture = client.sendAsync(request, HttpResponse.BodyHandlers.ofString());
  
          // Handle the response
          responseFuture.thenApply(HttpResponse::body)
                  .thenAccept(System.out::println)
                  .join(); // Wait for the response
      }
  }