You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by mb...@apache.org on 2003/11/04 03:14:04 UTC

cvs commit: jakarta-commons/httpclient/xdocs cookies.xml

mbecke      2003/11/03 18:14:04

  Modified:    httpclient/xdocs cookies.xml
  Log:
  Cookie doc updates to reflect new cookie code.
  
  PR: 24332
  Submitted by: Michael Becke
  Reviewed by: Oleg Kalnichevski
  
  Revision  Changes    Path
  1.4       +24 -34    jakarta-commons/httpclient/xdocs/cookies.xml
  
  Index: cookies.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/xdocs/cookies.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- cookies.xml	21 Jul 2003 13:05:03 -0000	1.3
  +++ cookies.xml	4 Nov 2003 02:14:04 -0000	1.4
  @@ -56,13 +56,18 @@
           </p>
         </subsection>
   
  -      <subsection name="Compatibility">
  +      <subsection name="Browser Compatibility">
           <p>The compatibility specification is designed to be compatible with as
           many different servers as possible even if they are not completely
           standards compliant. If you are encountering problems with parsing
           cookies, you should probably try using this specification.</p>
         </subsection>
   
  +      <subsection name="Ignore Cookies">
  +        <p>This cookie specification ignores all cookies.  It should be used to
  +        keep HttpClient from accepting and sending cookies.</p>
  +      </subsection>
  +
       </section>
   
       <section name="Unsupported Specifications">
  @@ -84,45 +89,30 @@
       </section>
   
       <section name="Specifying the Specification">
  -      <p>There is two ways to specify which cookie specification should be
  -      used, either for each HttpState instance, or by setting the default for
  -      newly created HttpState instances.</p>
  -
  -      <subsection name="Per HttpState">
  -        <p>In most cases, the best way to set which cookie specification to use
  -        is using the <code>setCookiePolicy(int policy)</code> method on
  -        <code>HttpState</code>.  Any HttpClient using that HttpState will then
  -        use the specified cookie policy.  The value of <code>policy</code>
  -        should be one of:</p>
  -        <ul>
  -          <li><code>CookiePolicy.COMPATIBILITY</code></li>
  -          <li><code>CookiePolicy.NETSCAPE_DRAFT</code></li>
  -          <li><code>CookiePolicy.RFC2109</code></li>
  -        </ul>
  +      <p>There are two ways to specify which cookie specification should be
  +      used, either for each <code>HttpMethod</code> instance using the 
  +      <code>HttpMethodParams</code>, or by setting the default value on
  +      <code>CookiePolicy</code>.</p>
  +
  +      <subsection name="Per HttpMethod">
  +        <p>In most cases, the best way to specify the cookie spec to use is the
  +        <code>setCookiePolicy(String policy)</code> method on
  +        <code>HttpMethodParams</code>.  The value of <code>policy</code>
  +        must be one of the values registered with <code>CookiePolicy.registerCookieSpec()</code>.</p>
   
           <source>
  -        HttpClient client = new HttpClient();
  -        client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);
  +        HttpMethod method = new GetMethod();
  +        method.getParams().setCookiePolicy(CookiePolicy.RFC_2109);
           </source>
         </subsection>
   
         <subsection name="Default">
  -        <p>The default cookie specification can be set by setting the system
  -        property <code>apache.commons.httpclient.cookiespec</code> to one
  -        of:</p>
  -
  -        <ul>
  -          <li><code>"COMPATIBILITY"</code></li>
  -          <li><code>"NETSCAPE_DRAFT"</code></li>
  -          <li><code>"RFC2109"</code></li>
  -        </ul>
  -
  -        <p>This setting will be used by any newly created HttpState objects,
  -        however existing HttpState instances will not be affected.</p>
  +        <p>The default cookie specification can be set by defining the default cookie
  +        policy on <code>CookiePolicy</code>.</p>
   
  -        <source>
  -        System.setProperty("apache.commons.httpclient.cookiespec", "COMPATIBILITY");
  -        </source>
  +        <source><![CDATA[
  +        CookiePolicy.registerCookieSpec(CookiePolicy.DEFAULT, <Some CookieSpec>);
  +        ]]></source>
         </subsection>
       </section>
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org