title: Resolved exception caused by Handler execution: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form
body: <p>I am working on <strong>Spring Boot MySQL</strong> example following link : <strong><a href="https://www.callicoder.com/spring-boot-rest-api-tutorial-with-mysql-jpa-hibernate/" rel="nofollow noreferrer">https://www.callicoder.com/spring-boot-rest-api-tutorial-with-mysql-jpa-hibernate/</a></strong>. I am getting below url when trying to access</p>
  
  <blockquote>
    <p>2018-04-14 22:29:54.987  WARN 9572 --- [nio-8080-exec-3] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/ZSC55.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZSC55.png" alt="enter image description here"></a></p>
  
  <p><strong>NoteController</strong></p>
  
  <pre><code>@RestController
  @RequestMapping("/api")
  public class NoteController {
  
      @Autowired
      private NoteRepository noteRepository;
  
      @GetMapping("/notes")
      public List&lt;Note&gt; getAllNotes(){
          return noteRepository.findAll();
      }
  
  
      @PostMapping("/notes")
      public Note createNote(@Valid @RequestBody Note note){
          return noteRepository.save(note);
      }
  
  
      @GetMapping("/notes/{id}")
      public Note getNoteById(@PathVariable(value = "id") Long noteId){
          return noteRepository.findById(noteId)
                  .orElseThrow(() -&gt; new ResourceNotFoundException("Note", "id", noteId));
      }
  
  
      @PutMapping("/notes/{id}")
      public Note updateNote(@PathVariable(value = "id") Long noteId,
                              @Valid @RequestBody Note noteDetails){
  
          Note note = noteRepository.findById(noteId)
                  .orElseThrow(() -&gt; new ResourceNotFoundException("Note", "id", noteId));
  
          note.setTitle(noteDetails.getTitle());
          note.setContent(noteDetails.getContent());
  
          Note updatedNote = noteRepository.save(note);
          return updatedNote;
      }
  
  
      @DeleteMapping("/notes/{id}")
      public ResponseEntity&lt;?&gt; deleteNote(@PathVariable(value="id") Long noteId){
          Note note = noteRepository.findById(noteId)
                  .orElseThrow(() -&gt; new ResourceNotFoundException("Note", "id", noteId));
  
          noteRepository.delete(note);
  
          return ResponseEntity.ok().build();
      }
  }
  </code></pre>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.1.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>