This is what I use. This sets the user agent string for the client, and hence I need to do it for every method call :

HttpClientParams params = httpclient.getParams();
// Make the user agent string configurable
params.setParameter("http.useragent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 
5.0");

HTH.

Henry Chen wrote:
GetMethod authget = new GetMethod(url);
authget.setRequestHeader(new Header(
                        "User-Agent",
                        "Mozilla/5.0 (Windows; U; Windows NT 5.1; en_US;
rv:1.8.1.4)Gecko/20070515 Firefox/2.0.0.4"));


-----Original Message-----
From: Bashiro [mailto:[EMAIL PROTECTED] Sent: Friday, September 14, 2007 11:25 AM
To: [email protected]
Subject: User-Agent



Hello guys,
What is the code snip for editing the
"User-Agent" header in httpClient.

Thanks
Bashiro


_______________________________________________
No banners. No pop-ups. No kidding.
Make My Way  your home on the Web - http://www.myway.com



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Madhur Kumar Tanwani <http://madhurtanwani.googlepages.com>
Gebo <http://feeds.feedburner.com/%7Er/Gebo/%7E6/1>

****************************************************************
* Imagine if every Thursday your shoes exploded if you tied them the *usual 
way*.
This happens to us all the time with *computers*, and nobody thinks of 
complaining. Johnson
****************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to