I have a very simple Spring Application (NOT spring boot). I have implemented a GET and POST controller methods. the GET method works fine. But the
Spring
GET
can you trying using the -d option in curl
curl -H "Content-Type: application/json" -X POST -d '{"id":"1,"name":"sai"}' http://localhost:8095/myApp/service/example/sample2
Also, if you use windows you should escape double quotes
-d "{ \"id\": 1, \"name\":\"sai\" }"