title: HttpRequest.BodyPublishers.ofString(jsonasstring) does not put anything in the POST request
body: <p>I'm trying to make a POST request with custom headers and json as string on body</p>
  <p>Here's my code</p>
  <pre><code>HttpRequest request2 = HttpRequest.newBuilder()
                  .uri(URI.create(POSTS_API_URL))
                  .headers(&quot;accept&quot;, &quot;text/plain; charset=UTF-8&quot;, &quot;XF-Api-Key&quot;, &quot;MYAPIKEY&quot;)
                  .POST(HttpRequest.BodyPublishers.ofString(json))
  
                  .build();
  
          System.out.println(request2); //result : https://******.fr/api/auth/ POST
          System.out.println(request2.headers()); //result : java.net.http.HttpHeaders@8e33ff08 { {accept=[text/plain; charset=UTF-8], XF-Api-Key=[MYAPIKEY]} }
  
          HttpResponse&lt;String&gt; response2 = client.send(request2, HttpResponse.BodyHandlers.ofString());
  
          // print status code
          System.out.println(response2.statusCode()); //400
          // print json code
          System.out.println(json); //{&quot;login&quot;:&quot;LunaLune&quot;,&quot;password&quot;:&quot;***********&quot;}
          // print response body
          System.out.println(response2.body()); //mandatory input missing : login, password
  </code></pre>
  <p>And my json String</p>
  <pre><code> String json = &quot;{&quot; +
                  &quot;\&quot;login\&quot;:\&quot;LunaLune\&quot;,&quot; +
                  &quot;\&quot;password\&quot;:\&quot;*********\&quot;&quot; +
                  &quot;}&quot;;
  </code></pre>
  <p>But when I print the request I get : https://*******.fr/api/auth/ POST</p>
  <p><strong>the POST request is empty</strong></p>
  <p>I googled many forums, code examples ect... but I see that my code where correct according many examples I seen.</p>
  <p>So if someone know what is my problem ?
  Thanks in advance !</p>