How do I read the response header from RestTemplate?

后端 未结 4 853
醉梦人生
醉梦人生 2020-12-05 06:34

I am posting information to a web service using RestTemplate.postForObject. Besides the result string I need the information in the response header. Is there any way to ge

4条回答
  •  执念已碎
    2020-12-05 07:29

    I don't know if this is the recommended method, but it looks like you could extract information from the response headers if you configure the template to use a custom HttpMessageConverter.

提交回复
热议问题