Return-Path: Delivered-To: apmail-hc-commits-archive@www.apache.org Received: (qmail 2864 invoked from network); 3 Feb 2009 22:39:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Feb 2009 22:39:54 -0000 Received: (qmail 35431 invoked by uid 500); 3 Feb 2009 22:39:54 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 35398 invoked by uid 500); 3 Feb 2009 22:39:54 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 35389 invoked by uid 99); 3 Feb 2009 22:39:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 14:39:54 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 22:39:49 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0C84D23889BB; Tue, 3 Feb 2009 22:39:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r740493 - /httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java Date: Tue, 03 Feb 2009 22:39:27 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090203223928.0C84D23889BB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Tue Feb 3 22:39:27 2009 New Revision: 740493 URL: http://svn.apache.org/viewvc?rev=740493&view=rev Log: Documented HTTP protocol version resolution, if not explicitly set at the construction time Modified: httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java Modified: httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java?rev=740493&r1=740492&r2=740493&view=diff ============================================================================== --- httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java (original) +++ httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/BasicHttpRequest.java Tue Feb 3 22:39:27 2009 @@ -34,6 +34,7 @@ import org.apache.http.HttpRequest; import org.apache.http.ProtocolVersion; import org.apache.http.RequestLine; +import org.apache.http.params.HttpParams; import org.apache.http.params.HttpProtocolParams; /** @@ -50,6 +51,21 @@ private RequestLine requestline; + /** + * Creates an instance of this class using the given request method + * and URI. The HTTP protocol version will be obtained from the + * {@link HttpParams} instance associated with the object. + * The initialization will be deferred + * until {@link #getRequestLine()} is accessed for the first time. + *

+ * The following HTTP parameters affect the initialization: + *

+ * The {@link CoreProtocolPNames#PROTOCOL_VERSION} + * parameter determines HTTP protocol version to be used for this request. + * + * @param method request method. + * @param uri request URI. + */ public BasicHttpRequest(final String method, final String uri) { super(); if (method == null) { @@ -63,10 +79,23 @@ this.requestline = null; } + /** + * Creates an instance of this class using the given request method, URI + * and the HTTP protocol version. + * + * @param method request method. + * @param uri request URI. + * @param ver HTTP protocol version. + */ public BasicHttpRequest(final String method, final String uri, final ProtocolVersion ver) { this(new BasicRequestLine(method, uri, ver)); } + /** + * Creates an instance of this class using the given request line. + * + * @param requestline request line. + */ public BasicHttpRequest(final RequestLine requestline) { super(); if (requestline == null) { @@ -77,10 +106,25 @@ this.uri = requestline.getUri(); } + /** + * Returns the HTTP protocol version to be used for this request. If an + * HTTP protocol version was not explicitly set at the construction time, + * this method will obtain it from the {@link HttpParams} instance + * associated with the object. + * + * @see #BasicHttpRequest(String, String) + */ public ProtocolVersion getProtocolVersion() { return getRequestLine().getProtocolVersion(); } + /** + * Returns the request line of this request. If an HTTP protocol version + * was not explicitly set at the construction time, this method will obtain + * it from the {@link HttpParams} instance associated with the object. + * + * @see #BasicHttpRequest(String, String) + */ public RequestLine getRequestLine() { if (this.requestline == null) { ProtocolVersion ver = HttpProtocolParams.getVersion(getParams());