Domanda

I have a Spring and Jersey application and has that line:

return Response.ok().header("Content-Type", "application/xml; charset=UTF-8").entity(restTemplate.postForObject(baseURL, entity, String.class)).build();

However when I debug at server side I see that Content-Type header is just application/xml. Any ideas?

È stato utile?

Soluzione

However when I debug at server side I see that Content-Type header is just application/xml

I am getting this in my code and during debug I can see the header which is proper.

Please verify.

I don't know but Sorry if I went wrong.

enter image description here

Altri suggerimenti

You have to set a separate header with

.header("charset", "UTF-8")

Seems like Jersey is reading the header value only upto the semicolon.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top