Open the URL
with URL.openConnection
. Optionally cast to HttpURLConnection
. Call URLConnection.setRequestProperty
/addRequestProperty
.
The default User-Agent header value is set from the "http.agent"
system property. The PlugIn and WebStart allow you to set this property.