Problems with Angular, CORS and Spring

后端 未结 3 1709
庸人自扰
庸人自扰 2020-12-18 16:57

I have a simple project based on @RestController and AngularJS. I can send GET requests from Angular to @RestController but i could not send POST request. I have an error in

3条回答
  •  执念已碎
    2020-12-18 17:28

    You could also consider using the native CORS support available in the upcoming Spring Framework 4.2 release. See this blog post for more details.

    By default, it is configured to automatically accept all the headers, so it should work as soon as you enable CORS support with CrossOrigin annotation or with Java config.

提交回复
热议问题