1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __CHTTPSERVICE_H__
17 #define __CHTTPSERVICE_H__
22 #include "httpheaderiter.h"
25 * CHttpService represent a handle to the HTTP service instance for a set of client
26 * HTTP transactions[a request and its equivalent response]. The application can
27 * specify connection preferences[proxy, max. no of connections allowed in a single
28 * HTTP service instance], pipelining, setting request headers that applies to all
29 * transactions that the CHttpService holds etc...
35 class CHttpService : public CBase
37 friend class CHttpClientTransactionImpl;
40 IMPORT_C static CHttpService* NewL();
41 IMPORT_C ~CHttpService();
43 IMPORT_C TInt String(TInt aStringId, TPtrC8& aPtr);
45 IMPORT_C TInt SetProxy(const TDesC8& aProxyAddress);
46 IMPORT_C const TDesC8& ProxyAddress() const;
48 IMPORT_C void SetMaxConnections(TInt aValue);
49 IMPORT_C TInt MaxConnections() const;
51 IMPORT_C void SetMaxTransactionsToPipeline(TInt aValue);
52 IMPORT_C TInt MaxTransactionsToPipeline() const;
54 IMPORT_C TInt AddRequestHeader(TInt aHeaderId, const THttpHeaderValueVariant& aHeaderValue);
55 IMPORT_C TInt AddCustomRequestHeader(const TDesC8& aHeaderName, const TDesC8& aHeaderValue);
62 class CHttpServiceStruct : public CBase
65 RHTTPSession iHttpSession;
66 RHTTPHeaders iSessionHeaders;
69 RHTTPSession Session()
71 return iHttpServiceStruct->iHttpSession;
76 CHttpServiceStruct* iHttpServiceStruct; // Implementation struct
79 #endif // __CHTTPSERVICE_H__