Forum Moderators: phranque

Message Too Old, No Replies

Java http headers

How do i change the http headers java sends when using java.net.url

         

lawrencephillips

12:28 pm on Oct 7, 2005 (gmt 0)

10+ Year Member



I've just written myself a small app in java (1.4.2) and I’ve been looking at the http headers it sends. I’d like to be able to change the user agent but I can't find where this is set. I've looked through the source for java.net.URL and the classes it imports but I couldn't see it. I'd also like to be able to set the referrer string, but this isn't essential yet.

Any suggestions of where to look would be greatly appreciated.

dylans

12:16 am on Oct 13, 2005 (gmt 0)

10+ Year Member



check out the HttpClient from Apache:
org.apache.commons.httpclient

i've found that the java.net stuff is maaaajorly lacking some very rudamentary features.