hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Holm <daniel.h...@gmail.com>
Subject Issue with replacing default header value
Date Thu, 21 Jul 2011 12:53:09 GMT
Hello everyone!
I'm trying to replace the value of some of my default headers on a per
request basis, but I'm not sure how to do this.

I'm setting the default headers on the client using :

client.getParams().setParameter(ClientPNames.DEFAULT_HEADERS, headers);

On some requests I need to replace the value of some of the default headers,
I do this like so:

request.setHeader(HttpHeaders.ACCEPT, "application/json");

When executing the request it has duplicate headers, one with the default
value and one with the new value. I would rather want to replace the default
value with the new one, how do I do this?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message