我有一个 Spring 和 Jersey 应用程序,并且有以下行:
return Response.ok().header("Content-Type", "application/xml; charset=UTF-8").entity(restTemplate.postForObject(baseURL, entity, String.class)).build();
但是,当我在服务器端调试时,我看到 Content-Type header 只是 application/xml。有什么想法吗?
最佳答案
However when I debug at server side I see that Content-Type header is just application/xml
我在代码中得到了这个,在调试过程中我可以看到正确的标题。
请验证。
我不知道,但如果我错了,抱歉。
关于java - Spring 更改 Content-Type 的 header ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23560563/