title: SpringBoot and @CrossOrigin annotation with POST only
body: <p>I have the following class</p>
  
  <pre><code>@RestController
  @RequestMapping("/bets")
  @CrossOrigin
  public class BetRestController {
  
      @Autowired
      private BetController betController;
  
      @ResponseBody
      @RequestMapping(method=RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
      public BetResource betOnGame(@RequestBody @Valid BetResource betResource) {
          return BetTranslator.from(betController.betOnGame(BetTranslator.from(betResource)));
      }
  
      @ResponseBody
      @RequestMapping(method = RequestMethod.GET)
      public List&lt;BetResource&gt; getAllBets() {
          return betController.getAllBets().stream().map(BetTranslator::from).collect(Collectors.toList());
      }
  }
  </code></pre>
  
  <p>The problem is that when I try to access the POST method I am getting:</p>
  
  <p>XMLHttpRequest cannot load <a href="http://localhost:8080/bets" rel="nofollow">http://localhost:8080/bets</a>. Origin <a href="http://localhost:3000" rel="nofollow">http://localhost:3000</a> is not allowed by Access-Control-Allow-Origin.</p>
  
  <p>but GET method works.</p>
  
  <p>What I have wrong in my configuration or maybe there is a bug in @CrossOrigin annotation processing?!</p>