hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Satsangi, Vivek " <Vivek.Satsa...@xerox.com>
Subject RE: How to overwrites Host header
Date Wed, 01 Mar 2006 19:13:07 GMT
Suppose the hostname you DON't WANT is bar.sun.com

You can then fake it out by 
A) Creating an entry in /etc/hosts for the name you want it to be.
Suppose this is foo.sun.com. Point foo.sun.com to the IP address of
bar.sun.com.

B) Only call the host by the name foo.fun.com. Then the host header in
the request will show foo.sun.com, while getting sent to bar.sun.com.

  

-----Original Message-----
From: otsuka [mailto:t.otsuka@gmail.com] 
Sent: Wednesday, March 01, 2006 11:55 AM
To: httpclient-user@jakarta.apache.org
Subject: How to overwrites Host header

Hi,

I want HttpClient to send "Host" request header value
which is different with the host connected. This
behaviour is necessary for authentication purpose.

Is it possible to overwrites Host header?
If yes, could you tell me how?

(my desired behaviour log)
DEBUG org.apache.commons.httpclient.HttpConnection  - Open connection
to www.example.com:80
DEBUG httpclient.wire.header  - >> "POST /path/to/something
HTTP/1.1[\r][\n]"
DEBUG httpclient.wire.header  - >> "Host: another.example.com[\r][\n]"


Regards,
Otsuka

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


---------------------------------------------------------------------
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