HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("User-Agent","user agent description");

Where url is an instance of java.net.URL

--------------------------------------------------------------
Rasmus T. Mohr            Direct  :             +45 36 910 122
Application Developer     Mobile  :             +45 28 731 827
Netpointers Intl. ApS     Phone   :             +45 70 117 117
Vestergade 18 B           Fax     :             +45 70 115 115
1456 Copenhagen K         Email   : mailto:[EMAIL PROTECTED]
Denmark                   Website : http://www.netpointers.com

"Remember that there are no bugs, only undocumented features."
--------------------------------------------------------------

-----Oprindelig meddelelse-----
Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]P�
vegne af Thomas Huber
Sendt: 15. marts 2002 00:00
Til: [EMAIL PROTECTED]
Emne: [Robots] Re: SV: matching and "User-Agent:" in robots.txt




How can the UA be set in Java?

> Create a user-agent object thus:
> 
> "$ua = LWP::RobotUA->new('Banjo/1.1','http://nowhere.int/banjo.html
> [EMAIL PROTECTED]')





--
This message was sent by the Internet robots and spiders discussion list
([EMAIL PROTECTED]).  For list server commands, send "help" in the body of
a message to "[EMAIL PROTECTED]".

--
This message was sent by the Internet robots and spiders discussion list 
([EMAIL PROTECTED]).  For list server commands, send "help" in the body of a message 
to "[EMAIL PROTECTED]".

Reply via email to