Http Post request with content type application/x-www-form-urlencoded not working in Spring
<p>Am new to spring currently am trying to do <em>HTTP POST request application/x-www-form-url encoded</em> but when i keep this in my headers then spring not recognizing it and saying <code>415 Unsupported Media Type</code>
for <code>x-www-form-urlencoded</code></p>

<blockquote>
  <p>org.springframework.web.HttpMediaTypeNotSupportedException: Content
  type 'application/x-www-form-urlencoded' not supported</p>
</blockquote>

<p>Can any one know how to solve it? please comment me.</p>

<p>An example of my controller is:</p>

<pre><code>@RequestMapping(
    value = "/patientdetails",
    method = RequestMethod.POST,
    headers="Accept=application/x-www-form-urlencoded")
public @ResponseBody List&lt;PatientProfileDto&gt; getPatientDetails(
        @RequestBody PatientProfileDto name
) { 
    List&lt;PatientProfileDto&gt; list = new ArrayList&lt;PatientProfileDto&gt;();
    list = service.getPatient(name);
    return list;
}
</code></pre>