title: Request method POST not supported
body: <p>GET works fine in the same controller. I have researched the error beforehand and no solution worked for me, unfortunately. I have created the simplest post i could imagine, and server still responds with</p>
  
  <pre><code>2015-05-04 01:05:56.669  WARN 6496 --- [-nio-420-exec-8] o.s.web.servlet.PageNotFound             : Request method 'POST' not supported
  </code></pre>
  
  <p>Response Headers in Chrome:</p>
  
  <pre><code>HTTP/1.1 405 Method Not Allowed
  Server: Apache-Coyote/1.1
  X-Content-Type-Options: nosniff
  X-XSS-Protection: 1; mode=block
  Cache-Control: no-cache, no-store, max-age=0, must-revalidate
  Pragma: no-cache
  Expires: 0
  X-Frame-Options: DENY
  Allow: HEAD, GET
  Content-Type: application/json;charset=UTF-8
  Transfer-Encoding: chunked
  Date: Sun, 03 May 2015 23:11:57 GMT
  </code></pre>
  
  <p>Request Headers</p>
  
  <pre><code>POST /api/test2 HTTP/1.1
  Host: localhost:420
  Connection: keep-alive
  Content-Length: 0
  Accept: application/json, text/plain, */*
  Origin: http://localhost:420
  User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36 OPR/29.0.1795.47
  Referer: http://localhost:420/
  Accept-Encoding: gzip, deflate, lzma
  Accept-Language: en-US,en;q=0.8
  Cookie: JSESSIONID=06176AA355A225D9532206FCDDDEF711
  </code></pre>
  
  <p>ViewController</p>
  
  <pre><code>@RestController
  @RequestMapping(value = "/api")
  public class ViewController {
  
      @RequestMapping(value = "/post2", method = RequestMethod.POST)
      public String itWorked2() {
          System.out.println("hell yeah it worked");
          return "No";
      }
  
  }
  </code></pre>
  
  <p>angular file view.js where it's accessed</p>
  
  <pre><code>$scope.teste2 = function() {
          $http.post(urlbase + 'api/test2').success(function(data) {
              console.log('yeah');
          }).error(function(data,status,headers,config) {
              console.log('no');
          });
  };
  </code></pre>
  
  <p>WorkingusersApplication</p>
  
  <pre><code>@SpringBootApplication
  public class WorkingusersApplication implements CommandLineRunner {
      @Override
      public void run(String... args) throws Exception {
  
          }
  
      public static void main(String[] args) {
          SpringApplication.run(WorkingusersApplication.class, args);
      }
  }
  </code></pre>
  
  <p>SecurityConfiguration</p>
  
  <pre><code>@Configuration
  @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)
  @EnableGlobalMethodSecurity(securedEnabled = true)
  public class SecurityConfiguartion extends WebSecurityConfigurerAdapter {
  
      @Autowired
      private DataSource dataSource;
  
      @Autowired
      private SecurityProperties security;
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http.
                  authorizeRequests().antMatchers("/home","/","/css/**","/js/**","/api/**","/post/**").permitAll().anyRequest().
                  fullyAuthenticated().and().formLogin().loginPage("/login").failureUrl("/login?error").permitAll().and().logout()
                  .logoutRequestMatcher(new AntPathRequestMatcher("/logout")).and()
                  .exceptionHandling().accessDeniedPage("/access?error").and().csrf().disable();
      }
  
      @Override
      public void configure(AuthenticationManagerBuilder auth) throws Exception {
          auth.jdbcAuthentication().dataSource(this.dataSource);
      }
  
  
  }
  </code></pre>
  
  <p>How do i solve this issue?</p>