Why is HttpEntity causing an HTTP Status 415 error in Spring?

You need to send a POST request so that there is a body to parse into an HttpEntity.

You need to send a POST request so that there is a body to parse into an HttpEntity. I would also recommend using the method attribute of the RequestMapping annotation so that you can specify which HTTP methods your mapping controller method handles. @RequestMapping(value = "/handle" method = RequestMethod.

POST) public HttpEntity handle(HttpEntity requestEntity) { HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders. Set("MyResponseHeader", "MyValue"); return new HttpEntity(" responseHeaders); } I believe you could also do something like this to deal with the request body as a String: @RequestMapping(value = "/handle" method = RequestMethod. POST) public String handle(@RequestBody String body) { HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.

Set("MyResponseHeader", "MyValue"); return new HttpEntity(" responseHeaders); }.

Yes. The same error is thrown. – rayseaward Aug 4 at 14:28.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions