common/inc/HttpClient.h
changeset 0 c316ab048e9d
equal deleted inserted replaced
-1:000000000000 0:c316ab048e9d
       
     1 /*
       
     2  * Name        : HttpClient.h
       
     3  * Description : HTTP helper class
       
     4  * Project     : This file is part of OpenMAR, an Open Mobile Augmented Reality browser
       
     5  * Website     : http://OpenMAR.org
       
     6  *
       
     7  * Copyright (c) 2010 David Caabeiro
       
     8  *
       
     9  * All rights reserved. This program and the accompanying materials are made available 
       
    10  * under the terms of the Eclipse Public License v1.0 which accompanies this 
       
    11  * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
       
    12  *
       
    13  */
       
    14 
       
    15 #ifndef HTTPCLIENT_H_
       
    16 #define HTTPCLIENT_H_
       
    17 
       
    18 #include <http/RHttpSession.h>
       
    19 #include <http/MHttpTransactionCallback.h>
       
    20 
       
    21 #include <es_sock.h>
       
    22 
       
    23 class CHttpClient : public CBase
       
    24 {
       
    25 public:
       
    26     static CHttpClient* NewL(MHTTPTransactionCallback& aCallback);
       
    27     ~CHttpClient();
       
    28 
       
    29 protected:
       
    30 	CHttpClient(MHTTPTransactionCallback& aCallback);
       
    31     void ConstructL();
       
    32 
       
    33 public:
       
    34     RHTTPTransaction GetL(const TDesC8& aUri);
       
    35     void Stop(RHTTPTransaction& aTransaction);
       
    36 
       
    37 protected:
       
    38     void SetHeaderL(RHTTPHeaders aHeaders, TInt aHdrField, const TDesC8& aHdrValue);
       
    39 
       
    40 private:
       
    41     MHTTPTransactionCallback& iCallback;
       
    42 
       
    43     RHTTPSession iSession;
       
    44     RSocketServ iSocketServ;
       
    45     RConnection iConnection;
       
    46 };
       
    47 
       
    48 #endif  // HTTPSOURCE_H_