How to POST form data with Spring RestTemplate?
<p>I want to convert the following (working) curl snippet to a RestTemplate call:</p>

<pre><code>curl -i -X POST -d "email=first.last@example.com" https://app.example.com/hr/email
</code></pre>

<p>How do I pass the email parameter correctly? The following code results in a 404 Not Found response:</p>

<pre><code>String url = "https://app.example.com/hr/email";

Map&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
params.put("email", "first.last@example.com");

RestTemplate restTemplate = new RestTemplate();
ResponseEntity&lt;String&gt; response = restTemplate.postForEntity( url, params, String.class );
</code></pre>

<p>I've tried to formulate the correct call in PostMan, and I can get it working correctly by specifying the email parameter as a "form-data" parameter in the body. What is the correct way to achieve this functionality in a RestTemplate?</p>