title: How to set Request Body parameter in rest api
body: <p>I have api using curl</p>
  <p><code>curl -X PUT &quot;http://localhost:8080/kie-server/services/rest/server/containers/containerid/tasks/210/expiration&quot; -H &quot;accept: application/json&quot; -H &quot;content-type: application/json&quot; -d &quot;{ \&quot;java.util.Date\&quot; : 1540025263987}&quot;</code></p>
  <p>Now I want to call this api using java code :</p>
  <p>I am using <code>javax.ws.rs.PUT</code> class for api calling and <code>HttpConnection</code> class.</p>
  <p>I have set the requestMethod(POST) and request property.<br />
  This is url i am using :<br />
  <code>http://localhost:8080/kie-server/services/rest/server/containers/&quot;+containerId+&quot;/tasks/&quot;+taskId+&quot;/expiration</code></p>
  <pre class="lang-java prettyprint-override"><code>url = new URL( http://localhost:8080/kie-server/services/rest/server/containers/&quot;+containerId+&quot;/tasks/&quot;+taskId+&quot;/expiration);
  conn.setRequestMethod(PUT);
  conn.setRequestProperty(&quot;Accept&quot;, &quot;application/json&quot;);
  conn.setRequestProperty(&quot;Content-Type&quot;, &quot;application/json&quot;);
  </code></pre>
  <p>I want to pass this parameter to api but not sure which method to use ?</p>
  <pre class="lang-json prettyprint-override"><code>{java.util.Date:1534343434&quot;};
  </code></pre>
  <p>This parameter is passed in body.</p>
  <p>Can anyone suggest how do I pass this parameter in java rest api ??</p>