Set SystemProperty "http.agent"
I've seen this question posted before including here, but nowhere with an answer.
I am trying to parse information from a webpage -- however, I keep getting a 403 error due to the user agent being invalid.
When I set:
System.setProperty("http.agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19");
Java appends itself to the end: Java/1.5.0_19
Since the order of precedence is right to left, java supersedes everything else and the website denies access.
Is there any way to prevent java from appending it's versioning information?
I saw talk of custom http interaction but no explanation. Thanks for your advice!