-
|
Jetty Version Jetty Environment Java Version Question How do get this information if not exposed via Response headers in Jetty HTTP Client? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
|
Seems the original response header is removed here: |
Beta Was this translation helpful? Give feedback.
-
|
You can turn off the automatic content decoding, and the header will still be seen. |
Beta Was this translation helpful? Give feedback.
-
|
Look at https://jetty.org/docs/jetty/12.1/programming-guide/client/http.html#content-response There it details how the content decoders works, and a code snippet on how to clear the automatic content decoders. |
Beta Was this translation helpful? Give feedback.
-
|
I don't want to disable the automatic decompression. Any way to get info about compression while still leveraging auto decompression? |
Beta Was this translation helpful? Give feedback.
-
|
You can get the headers by registering a header listener (note the singular in the method name): httpClient.newRequest(...)
.onResponseHeader((response, field) -> true)
...
.send();The Return Documentation here: |
Beta Was this translation helpful? Give feedback.
You can get the headers by registering a header listener (note the singular in the method name):
The
fieldparameter contains the raw header field (name and value) as it arrived from the network, before the processing performed by the decoder logic.Return
trueto keep the header,falseto remove the header.Documentation here:
https://jetty.org/docs/jetty/12.1/programming-guide/client/http.html#listeners