I've tried adding in a Filter
and the response.getHeaderNames()
doesn't have anything.
I've also tried adding in a @ControllerAdvice
to a class that implements ResponseBodyAdvice
and doing a response.getHeaders()
on the ServerHttpResponse
object - it says it has no headers. But when I curl an endpoint, I see lots of headers being returned.
How do I get all headers from a response in Spring Boot? Additionally, there doesn't seem to be a way to get the returned HTTP protocol from a response either.