title: error 415 Unsupported Media Type for an angular spring boot application
body: <p>I develop a  angular 8 Spring boot 2 application</p>
  
  <p>I try to send a POST request from an angular service, but I have the error 415 Unsupported Media Type</p>
  
  <p>service angular</p>
  
  <pre><code>const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
  const options = { headers: headers };
  return this.http.post&lt;Search&gt;('/api/produitimmobilier/all', search, options).pipe(.......
  </code></pre>
  
  <p>I tried 2 configuration of my spring boot 2 controller:</p>
  
  <pre><code>@RequestMapping(value = "/produitimmobilier/all",
  method = RequestMethod.POST,consumes ="application/json")
  @ResponseBody
  public Search findAll(@RequestBody Search search){
  </code></pre>
  
  <p>and</p>
  
  <pre><code>@RequestMapping(value = "/produitimmobilier/all",
  method = RequestMethod.POST,consumes = {"text/plain;charset=UTF-8", MediaType.APPLICATION_JSON_VALUE})
  @ResponseBody
  public Search findAll(@RequestBody Search search){
  </code></pre>
  
  <p>but I have the same error. Can you help me ?</p>