title: How to troubleshoot message=Request method 'POST' not supported as "application/json"
body: <p>I am building a Spring Boot application that allows the user to save documents to the sever that they create and edit through Tinymce.</p>
  
  <p>But when I click the save button I get this error regarding POST:</p>
  
  <pre><code>Resolving exception from handler [null]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
  </code></pre>
  
  <p>...</p>
  
  <pre><code>Request method 'POST' not supported
  
  status=405, error=Method Not Allowed, exception=org.springframework.web.HttpRequestMethodNotSupportedException, message=Request method 'POST' not supported, path=/docs}] as "application/json" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
  </code></pre>
  
  <p>From my Controller for Docs</p>
  
  <pre><code>@ResponseBody
      @RequestMapping(value = "/{name}", method = RequestMethod.POST, produces="text/html", consumes={"application/json","application/xml"} )
      public String addTodos(@PathVariable("name") String name) {
  
          docsService.addDocs(name);
  
          return "200 OK";
      }
  
  
      @ResponseBody
      @RequestMapping(value = "/{name}", method = RequestMethod.PUT, produces="text/html", consumes = {"application/json","application/xml"})
      public String updateComplated(@PathVariable("name") String name) {
  
          docsService.updateComplated(name);
  
          return "200 OK";
      }
  </code></pre>
  
  <p>What I do not understand about this error is that I clearly specify how to handle the POST method, yet it says it does not exist.</p>
  
  <p>Can someone please guide me on how to troubleshoot this?</p>
  
  <p>Here is a screenshot from Firefox developer tools showing Response and Request headers</p>
  
  <p><a href="https://i.stack.imgur.com/NoEv7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NoEv7.png" alt="enter image description here"></a></p>
  
  <p>The params look like this:
  <a href="https://i.stack.imgur.com/DDlla.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DDlla.png" alt="Params"></a></p>