When I create a HTTPClient and use the setRequestHeader method this doesn't have effect for some headers.
Headers that are nog being set:
Accept-Encoding (in the code example i set this to 'gzip, deflate', in the sniffer the value is 'gzip'.)
Connection (in the code example i set this to 'Keep-Alive', in the sniffer the value is 'close'.)
(maybe there are more headers that are not being set but I tested with this 2 headers)
Headers that are set correctly:
In the attachment you can find the code as well as a screenprint of fiddler (the http sniffer tool i use)