hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julius Davies <juliusdav...@cucbc.com>
Subject 3.0-rc1 doesn't like my "host" header
Date Thu, 31 Mar 2005 18:29:31 GMT
Hi, Fellow HttpClient Users,

I'm getting different behaviour between 2.0.2 and 3.0 when I explicitly
set a "host" header.

Here's the code:

HttpClient client = new HttpClient();
GetMethod m = new GetMethod( "http://www.google.ca/" );
m.setRequestHeader( "host", "garbanzo" );
client.executeMethod( m );

How can I set the "host" header to "garbanzo" in 3.0?


commons-httpclient-3.0-rc1.jar
=========================================
>> "GET / HTTP/1.1[\r][\n]"
>> "User-Agent: Jakarta Commons-HttpClient/3.0-rc1[\r][\n]"
>> "Host: www.google.ca[\r][\n]"


commons-httpclient-2.0.2.jar
=========================================
>> "GET / HTTP/1.1[\r][\n]"
>> "host: garbanzo[\r][\n]"
>> "User-Agent: Jakarta Commons-HttpClient/2.0.2[\r][\n]"


yours,

Julius

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message