Skip to content
Discussion options

You must be logged in to vote

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 field parameter contains the raw header field (name and value) as it arrived from the network, before the processing performed by the decoder logic.

Return true to keep the header, false to remove the header.

Documentation here:
https://jetty.org/docs/jetty/12.1/programming-guide/client/http.html#listeners

Replies: 5 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@sbordet
Comment options

@kwin
Comment options

@sbordet
Comment options

@joakime
Comment options

joakime Jan 28, 2026
Collaborator

@kwin
Comment options

Answer selected by kwin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants
Converted from issue

This discussion was converted from issue #14399 on January 28, 2026 10:08.