Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I modify a response's ReadOnlyHttpHeaders in Spring?

RestTemplate.exchange is returning a ResponseEntity with ReadOnlyHttpHeaders. I want to add/modify these headers but since it is read only how do I do that?

like image 602
Jumpman Avatar asked Jan 25 '23 14:01

Jumpman


1 Answers

In case of above answer did not work for you, try below

HttpHeaders httpHeaders = HttpHeaders.writableHttpHeaders(httpEntity.getHeaders());
like image 110
ExploreEv Avatar answered Jan 28 '23 03:01

ExploreEv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!