title: Spring Boot 405 POST method not supported?
body: <p>How could POST method not support by Spring Boot MVC ?! I am trying to implement a simple post method that accepts a list of entities : here is my code  </p>
  
  <pre><code>@RestController(value="/backoffice/tags")
  public class TagsController {
  
      @RequestMapping(value = "/add", method = RequestMethod.POST)
          public void add(@RequestBody List&lt;Tag&gt; keywords) {
              tagsService.add(keywords);
          }
  }
  </code></pre>
  
  <p>Hitting this URL like this:  </p>
  
  <pre><code>http://localhost:8090/backoffice/tags/add
  </code></pre>
  
  <p>Request Body: </p>
  
  <pre><code>[{"tagName":"qweqwe"},{"tagName":"zxczxczx"}]
  </code></pre>
  
  <p>I receive:</p>
  
  <pre><code>{
      "timestamp": 1441800482010,
      "status": 405,
      "error": "Method Not Allowed",
      "exception": "org.springframework.web.HttpRequestMethodNotSupportedException",
      "message": "Request method 'POST' not supported",
      "path": "/backoffice/tags/add"
  } 
  </code></pre>
  
  <p><strong>EDIT</strong>: </p>
  
  <p>Debugging Spring Web Request Handler </p>
  
  <pre><code>     public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              this.checkRequest(request); 
  
   protected final void checkRequest(HttpServletRequest request) throws ServletException {
          String method = request.getMethod();
          if(this.supportedMethods != null &amp;&amp; !this.supportedMethods.contains(method)) {
              throw new HttpRequestMethodNotSupportedException(method, StringUtils.toStringArray(this.supportedMethods));
          } else if(this.requireSession &amp;&amp; request.getSession(false) == null) {
              throw new HttpSessionRequiredException("Pre-existing session required but none found");
          }
      }
  </code></pre>
  
  <p>The only two methods in <code>supportedMethods</code> are <code>{GET,HEAD}</code>  </p>