title: Can spring boot controller receive plain/text?
body: <p>I am trying to process a POST request with body of plain text (utf-8) but it seems that spring does not like the plain text nature of the call. Could it be that it is not supported - or otherwise, am I coding it wrong?</p>
  
  <pre><code>@RestController
  @RequestMapping(path = "/abc", method = RequestMethod.POST)
  public class NlpController {
      @PostMapping(path= "/def", consumes = "text/plain; charset: utf-8", produces = MediaType.APPLICATION_JSON_VALUE)
      public ResponseEntity&lt;Object&gt; doSomething(@RequestBody String bodyText)
      {
          ...
          return ResponseEntity.ok().body(responseObject);
      }
  }
  </code></pre>
  
  <p>Respond is:</p>
  
  <p>Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded' not supported]</p>
  
  <p>I tested with curl command:</p>
  
  <pre><code>curl -s -X POST -H 'Content-Type: text/plain; charset: utf-8' --data-binary @text.txt localhost:8080/abc/def
  </code></pre>
  
  <p>The text.txt contains plain text (UTF-8 in Hebrew).</p>