title: How to POST form parameters?
body: <p>I'm trying to send HTTP POST form parameters. I know the Content-Type has to be <code>application/x-www-form-urlencoded</code> and parameters must be encoded in the request body.</p>
  
  <p><a href="https://www.eclipse.org/jetty/documentation/9.0.6.v20130930/http-client-api.html" rel="nofollow noreferrer">In version 9.0.6</a>, Jetty seems to have done this automatically:</p>
  
  <blockquote>
    <p>The POST request is sent with the application/x-www-form-urlencoded content type, and POST parameter values are automatically URL-encoded.</p>
  </blockquote>
  
  <p>But <a href="https://www.eclipse.org/jetty/documentation/9.4.19.v20190610/http-client-api.html" rel="nofollow noreferrer">in version 9.4.19</a>, I see the documentation has changed and now it says:</p>
  
  <blockquote>
    <p>The POST parameter values added via the param() method are automatically URL-encoded.</p>
  </blockquote>
  
  <p>Sure enough, invoking:</p>
  
  <pre><code>httpClient.POST("http://example.com/entity/1")
          .param("p", "value")
          .send();
  </code></pre>
  
  <p>Now treats the parameters as URL query parameters. Nothing gets added to the request body.</p>
  
  <p>What is the correct way to properly POST form parameters?</p>