title: How to modify the header of a HttpUrlConnection
body: <p>Im trying to improve the Java Html Document a little but i'm running into problems with the <code>HttpUrlConntion</code>. One thing is that some servers block a request if the user agent is a Java VM. Another problem is that the <code>HttpUrlConnection</code> does not set the <code>Referrer</code> or <code>Location</code> header field. Since several sites use these fields to verify that the content was accessed from their own site, I'm blocked here as well. As far as I can see the only resolution is to replace the URL handler of the HTTP protocol. Or is there any way to modify the default HTTP Handler?</p>