title: How to map a JSON response to a Java class using Java 11 HttpClient and Jackson?
body: <p>I'm new to the Java 11 HttpClient and would like to give it a try. I have a simple GET request that return JSON and I would like to map the JSON response to a Java class called <code>Questionnaire</code>.</p>
  
  <p>I understand that I can turn the response out of box into a String or an input stream like this</p>
  
  <pre class="lang-java prettyprint-override"><code>HttpRequest request = HttpRequest.newBuilder(new URI(String.format("%s%s", this.baseURI, "/state")))
            .header(ACCEPT, APPLICATION_JSON)
            .PUT(noBody()).build();
  
  HttpResponse&lt;String&gt; response = this.client.send(request, HttpResponse.BodyHandlers.ofString());
  </code></pre>
  
  <p>How can I write something that converts the JSON string to my Questionnaire class like this?</p>
  
  <pre class="lang-java prettyprint-override"><code>HttpResponse&lt;Questionnaire&gt; response = this.client.send(request, HttpResponse.BodyHandlers./* what can I do here? */);
  </code></pre>
  
  <p>I use Jackson to transform JSON into Java class instances. Is there Jackson support for the new Java standard HttpClient yet?</p>
  
  <p><strong>UPDATE 1</strong>
  I was not precise enough, sorry about that. I am looking for a blocking get example. I was aware of <a href="http://openjdk.java.net/groups/net/httpclient/recipes.html#jsonGet" rel="noreferrer">http://openjdk.java.net/groups/net/httpclient/recipes.html#jsonGet</a></p>