ah... thanks for the answer... I forgot to say that I managed to make it work but I had to add this:
System.setProperty("sun.net.http.allowRestrictedHeaders", "true"); Carlos. El 17/4/18 a las 17:16, Colm O hEigeartaigh escribió: > Using the CXF WebClient API and doing something like this works for me: > > client.header("Host", "www.example.com"); > > Colm. > > On Mon, Apr 16, 2018 at 2:33 PM, Carlos Sierra Andrés <csie...@gmail.com> > wrote: > >> Hello all, >> >> I am working on some testing and I would need to "persuade" JAX-RS >> client to send a different "Host" header. >> >> I have tried both setting the header in the client builder chain and >> registering a ClientRequestFilter that would change that header, both >> without any success. >> >> Is there any good way of doing this? >> >> Thank you very much in advance. >> >> Carlos. >> >> >> >