Clarify URI content in Execution Context

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1043518 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2010-12-08 16:53:46 +00:00
parent 40ef33ce81
commit 6ec87d3ce7
2 changed files with 9 additions and 2 deletions

View File

@ -543,7 +543,11 @@ byte[] response = httpclient.execute(httpget, handler);
<formalpara> <formalpara>
<title><constant>ExecutionContext.HTTP_REQUEST</constant>='http.request':</title> <title><constant>ExecutionContext.HTTP_REQUEST</constant>='http.request':</title>
<para><interfacename>HttpRequest</interfacename> instance representing the <para><interfacename>HttpRequest</interfacename> instance representing the
actual HTTP request.</para> actual HTTP request.
The final HttpRequest object in the execution context always represents
the state of the message _exactly_ as it was sent to the target server.
Per default HTTP/1.0 and HTTP/1.1 use relative request URIs.
</para>
</formalpara> </formalpara>
</listitem> </listitem>
<listitem> <listitem>

View File

@ -185,6 +185,9 @@ httpclient.getConnectionManager().shutdown();
updated depending on the execution context. Therefore the final request properties such updated depending on the execution context. Therefore the final request properties such
as the target host and request URI can be determined by examining the content of the as the target host and request URI can be determined by examining the content of the
local HTTP context after the request has been executed.</para> local HTTP context after the request has been executed.</para>
<para>The final HttpRequest object in the execution context always represents
the state of the message _exactly_ as it was sent to the target server.
Per default HTTP/1.0 and HTTP/1.1 use relative request URIs.</para>
<programlisting><![CDATA[ <programlisting><![CDATA[
DefaultHttpClient httpclient = new DefaultHttpClient(); DefaultHttpClient httpclient = new DefaultHttpClient();
@ -197,7 +200,7 @@ HttpUriRequest req = (HttpUriRequest) localContext.getAttribute(
ExecutionContext.HTTP_REQUEST); ExecutionContext.HTTP_REQUEST);
System.out.println("Target host: " + target); System.out.println("Target host: " + target);
System.out.println("Final request URI: " + req.getURI()); System.out.println("Final request URI: " + req.getURI()); // relative URI
System.out.println("Final request method: " + req.getMethod()); System.out.println("Final request method: " + req.getMethod());
]]></programlisting> ]]></programlisting>
</section> </section>