I am newbie in spring boot rest services. I have developed some rest api in spring boot using maven project.
I have successfully developed Get and <
To build on the accepted answer
Many HTTP client libraries (eg Axios) implicitly set a Content-Type: JSON
header for POST requests. In my case, I forgot to allow that header causing only POSTS to fail.
@Bean
CorsConfigurationSource corsConfigurationSource() {
...
configuration.addAllowedHeader("Content-Type"); // <- ALLOW THIS HEADER
...
}