You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Alex <al...@optonline.net> on 2006/04/06 11:24:12 UTC

[commons-httpclient] changing request's header

Hello,

 

I am trying to connect to a URL which gives me message (its source) "Your
browser does not satisfy software requirements. Please contact Customer
Support or use more widespread versions of browsers, such as Internet
Explorer or Opera."

 

How can I set User-Agent or something so that site thinks I am using
Internet Explorer or something. Is there a way to do it?

 

Thanks


RE: [commons-httpclient] changing request's header

Posted by Alex <al...@optonline.net>.
Thanks Oleg, before I was using 
httpclient.getParams().setParameter(
 HttpClientParams.USER_AGENT, 
 "Mozilla/4.0") so it didn't work. Needed to put full user-agent

-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org] 
Sent: Thursday, April 06, 2006 6:18 AM
To: Jakarta Commons Users List
Subject: Re: [commons-httpclient] changing request's header

On Thu, 2006-04-06 at 05:24 -0400, Alex wrote:
> Hello,
> 
>  
> 
> I am trying to connect to a URL which gives me message (its source) "Your
> browser does not satisfy software requirements. Please contact Customer
> Support or use more widespread versions of browsers, such as Internet
> Explorer or Opera."
> 
>  
> 
> How can I set User-Agent or something so that site thinks I am using
> Internet Explorer or something. Is there a way to do it?
> 

HttpClient httpclient = new HttpClient();
httpclient.getParams().setParameter(
 HttpClientParams.USER_AGENT, 
 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");

HTH

Oleg

>  
> 
> Thanks
> 


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


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


Re: [commons-httpclient] changing request's header

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2006-04-06 at 05:24 -0400, Alex wrote:
> Hello,
> 
>  
> 
> I am trying to connect to a URL which gives me message (its source) "Your
> browser does not satisfy software requirements. Please contact Customer
> Support or use more widespread versions of browsers, such as Internet
> Explorer or Opera."
> 
>  
> 
> How can I set User-Agent or something so that site thinks I am using
> Internet Explorer or something. Is there a way to do it?
> 

HttpClient httpclient = new HttpClient();
httpclient.getParams().setParameter(
 HttpClientParams.USER_AGENT, 
 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");

HTH

Oleg

>  
> 
> Thanks
> 


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