I am using Jetty client v9 to issue requests to a server. The address of the server I specify has to be in the form of actual (numeric) IP address for various reasons not important for this question, but I would like to pass the assumed host name (i.e. FQDN, not numeric) in the Host header. I've tried the following:
request = httpClient.newRequest(url);
request.method(HttpMethod.GET);
...
request.header(HttpHeader.HOST, hostHeader);
But found that this has no effect. The value of the "Host" header included in the actual request is still the one from the URL (containing the numeric IP address). I did verify that 'hostHeader' variable above does contain the correct value (that I would want).
Can anyone provide some insight as to how to override this default behaviour?
Thanks in advance!