I am using spring boot, here is the maven dependency
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
For web pages, I place the files in the src / main / resources / static file. There I have html files, js libraries (angular, jquery) and css files.
I am trying to make an HTTP POST request using Angular (I also have a GET request that works fine), but I get this
POST http://localhost:8080/xxxx/12/addEntry 405 (Method Not Allowed)
In response headers
HTTP/1.1 405 Method Not Allowed Server: Apache-Coyote/1.1 X-Application-Context: application Allow: HEAD, GET Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked Date: Wed, 09 Jul 2014 13:04:05 GMT
I understand that allow does not have a POST method in the answer.
Method in the controller
@RequestMapping(value = "/xxxx/{uid}/addEntry", method = RequestMethod.POST) @ResponseBody public String createEntry(@PathVariable String uid, @RequestBody String form) { System.out.println(form); return "index.html"; }
spring spring-boot spring-mvc
agusgambina
source share