The URL class does not, because it is used only for representing URLs.
The URLConnection class, on the other hand, has several methods for
this sort of thing:
static setDefaultRequestProperty
setIfModifiedSince
setRequestProperty
These will let you set whatever headers you want. For example:
conn.setRequestProperty("User-Agent", "MadDog/1.5");
One caveat: The user agent actually sent will look like this:
MadDog/1.5, JavaJDK1.1beta3.3
which is a little annoying.
-John.
John R. R. Leavitt | Director, Advanced Technologies | Lycos Inc
412 208 1033 | jrrl@lycos.com | http://polarbear.eng.lycos.com/jrrl/
with some luck i just might keep on climbing
better to climb than to face any fall
_________________________________________________
This messages was sent by the robots mailing list. To unsubscribe, send mail
to robots-request@webcrawler.com with the word "unsubscribe" in the body.
For more info see http://info.webcrawler.com/mak/projects/robots/robots.html