title: How can I send a JSON request using Jetty API Client?
body: <p>I'm trying to send a JSON string to a Server using Jetty HttpClient, but I didn't found any good example about how can I do that, only request where the client send simple params by POST. </p>
  
  <p>I manage to send the request using Apache HttpClient, but then I 've issues to keep the session when I perform the next request. </p>
  
  <pre class="lang-java prettyprint-override"><code>// rpcString is a json like  {"method":"Login","params":["user","passw"],"id":"1"}:
  entity = new StringEntity(rpcString, HTTP.UTF_8);
  HttpPost httpPost = new HttpPost("http://site.com:8080/json/users");
  entity.setContentType("application/json");
  httpPost.setEntity(entity);
  client = HttpClientBuilder.create().build();
  CloseableHttpResponse response = (CloseableHttpResponse) client.execute(httpPost);
  </code></pre>
  
  <p>If is possible, I like to do the same using jetty API client. </p>
  
  <p>Thanks.  </p>