[prog] Re: changing java's standard useragent

Meredydd Luff meredydd.luff at googlemail.com
Thu Sep 7 23:25:43 UTC 2006


Hey there,

Sorry to take so long, but something like:

urlconn.setRequestProperty("User-Agent", "Henna's Magic Bot v1.0");

should do the trick.

Meredydd

On 9/5/06, henna <hennar at gmail.com> wrote:
> eep,
>
> does anybody on this list have experience getting webpages from within
> a java program? I'm trying to change java's standard useragent but
> can't seem to figure out where to do it.
>
> URL adminURL = new URL(someURL);
> URLConnection urlconn = adminURL.openConnection();
> BufferedInputStream adminbuf = new
> BufferedInputStream(urlconn.getInputStream());
>
> any hints on how to change it, or libraries which allow you to change
> would be greatly appreciated :)
>
> thx
> henna
> --
> "Maybe you knew early on that your track went from point A to B, but
> unlike you I wasn't given a map at birth!" Alyssa, "Chasing Amy"
> _______________________________________________
> Programming mailing list
> Programming at linuxchix.org
> http://linuxchix.org/mailman/listinfo/programming
>


More information about the Programming mailing list