I am working on java restful web service. I got it working for GET request, but POST request does not work. My Controller class is RestController
. I have done these
I bet that call from Postman does not include Content-Type: application/json
.
HTTP 415 means that the server does not understand the media format of the request. In your controller you are specifying it accepts JSON, but you have not said if the request indicated that the body is in that format. Just because you put the data in JSON format, does not mean that the server is going to recognize it, you have to indicate it in the Content-Type
header.