Symbian3/SDK/Source/GUID-E50FC36D-949A-42E0-97A6-64D336DF8057.dita
changeset 7 51a74ef9ed63
parent 0 89d6a7a84779
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-E50FC36D-949A-42E0-97A6-64D336DF8057" xml:lang="en"><title>HTTP
       
    13 Version Property</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>By default, HTTP sessions use HTTP/1.1. To use HTTP/1.0, the connection
       
    15 information property <codeph>HTTP::EHTTPVersion</codeph> must be set to <codeph>HTTP::EHttp10</codeph>. </p>
       
    16 <p>From <filepath>HTTPEXAMPLECLIENT</filepath>: </p>
       
    17 <codeblock id="GUID-6555A0B4-B05A-5270-9F04-E577E0916714" xml:space="preserve">switch(cmd)
       
    18     {
       
    19     case EVersion10:
       
    20         SetHttpVersion(HTTP::EHttp10);
       
    21         break;
       
    22     case EVersion11:
       
    23         SetHttpVersion(HTTP::EHttp11);
       
    24         break;
       
    25         ...
       
    26 
       
    27 void CHttpClient::SetHttpVersion(HTTP::TStrings aHttpVersion)
       
    28     {
       
    29     RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
       
    30     RStringPool p=iSess.StringPool();
       
    31     connInfo.SetPropertyL(p.StringF(HTTP::EHTTPVersion,RHTTPSession::GetTable()),THTTPHdrVal(p.StringF(aHttpVersion)));
       
    32     }</codeblock>
       
    33 <p>The version chosen will apply to all new transactions following the property
       
    34 change, but will not affect any transactions currently in progress.</p>
       
    35 <p>As HTTP/1.1 mandates the use of a persistent connection for requests made
       
    36 in series to a single origin server, the default behaviour of HTTP Client
       
    37 is to set up persistent connections for each transaction. This can be overridden
       
    38 by specifying a Connection header in the client request. </p>
       
    39 </conbody></concept>