title: Spring Boot Content type 'multipart/form-data;boundary=--------------------------#;charset=UTF-8' not supported
body: <p>I'm new to Spring...I have a Spring Boot API application and all of my methods (POST, GET, etc) work great with Postman when the Content-Type is set to application/json, I can send and receive JSON.</p>
  
  <p>However, I'd really like for my methods to also accept a GET or POST in the browser.  When I use the browser to do a GET, the API returns an INTERNAL_SERVER_ERROR.  I created a small form and try to POST to my API, but then I get the UNSUPPORTED_MEDIA_TYPE: Content type 'multipart/form-data;boundary=--------------------------802438220043016845671644;charset=UTF-8' not supported</p>
  
  <p>These are 2 of the methods in my @RestController:</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.POST, value = {"","/"})
  public ResponseEntity&lt;MyModel&gt; createModel(@Valid @RequestBody MyModelDto modelDto) {
      MyModel model = modelService.createModel(modelDto);
      URI createdModelUrl = ServletUriComponentsBuilder.fromCurrentRequest().path("/{identifier}")
              .buildAndExpand(model.getIdentifier()).normalize().toUri();
      return ResponseEntity.created(createdModelUrl).build();
  
  @RequestMapping(method = RequestMethod.GET, value = "/{identifier}")
  public Resource&lt;MyModel&gt; getByIdentifier(@PathVariable("identifier") String identifier) {
      MyModel model = modelService.getByIdentifier(identifier);
      Resource&lt;MyModel&gt; resource = new Resource&lt;&gt;(model);
      return resource;
  }
  </code></pre>
  
  <p>If there's any other code that would be helpful to show, let me know and I'll update the thread.</p>