title: Parse POST body to java object using spark
body: <p>I migrated from spring to spark while ago and now I'm stuck at something basic.</p>
  
  <p>When I make a POST request sending data in the body I want to have the JAVA object back in the controller..</p>
  
  <p>In spring I used to do </p>
  
  <pre><code>@RequestBody User user
  </code></pre>
  
  <p>And it was "filled" automatically..</p>
  
  <p>Now with spark I have the method:</p>
  
  <pre><code>request.body();
  </code></pre>
  
  <p>But that gives me a serialized string like this:</p>
  
  <p><code>id=7&amp;name=Pablo+Mat%C3%ADas&amp;lastname=Gomez&amp;githubUsername=pablomatiasgomez</code></p>
  
  <p>So how can I get the User DTO ?</p>
  
  <p>Of course, the User class has the properties</p>
  
  <ul>
  <li>id</li>
  <li>name</li>
  <li>lastname</li>
  <li>githubUsername</li>
  </ul>