hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Madhur Kumar Tanwani <madhurtanw...@gmail.com>
Subject Re: User-Agent
Date Mon, 17 Sep 2007 05:38:18 GMT
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:bashiro@myway.com] 
> Sent: Friday, September 14, 2007 11:25 AM
> To: httpclient-user@jakarta.apache.org
> 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: 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
>
>
>   


-- 
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: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message