Index: package.html =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/package.html,v retrieving revision 1.5 diff -u -r1.5 package.html --- package.html 21 Jul 2002 04:12:45 -0000 1.5 +++ package.html 24 Jul 2002 01:15:22 -0000 @@ -98,5 +98,24 @@ %HH format. + +

HttpClient Configuration with Java Properties

+ Java properties can be set at run time with the -Dname=value + command line arguments to the application that uses HttpClient. + These properties can also be set programaticly by calling + System.getProperties().setProperty(name, value). + This is the list of properties that HttpClient recognizes: + + + + + + + + +
NameTypeEffect
httpclient.useragentString + Sets the User-Agent string to be sent on every HTTP request.
httpclient.authentication.preemptiveboolean + Sends authorization credentials without requiring explicit requests + from the web server
Index: HttpMethodBase.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v retrieving revision 1.35 diff -u -r1.35 HttpMethodBase.java --- HttpMethodBase.java 23 Jul 2002 14:38:31 -0000 1.35 +++ HttpMethodBase.java 24 Jul 2002 01:15:22 -0000 @@ -1536,7 +1536,13 @@ private static final Log wireLog = LogFactory.getLog("httpclient.wire"); /** User-Agent: Jakarta HTTP Client/1.0 header. */ - protected static final Header USER_AGENT = new Header("User-Agent", "Jakarta HTTP Client/2.0.0a1"); + protected static final Header USER_AGENT; + + static { + String agent = System.getProperties().getProperty( + "httpclient.useragent", "Jakarta HTTP Client/2.0M1"); + USER_AGENT = new Header("User-Agent", agent); + } }