CHttpService Class Reference

#include <mw/chttpservice.h>

Link against: httpservice.lib

class CHttpService : public CBase

Inherits from

Constructor & Destructor Documentation

~CHttpService ( )

IMPORT_C~CHttpService()

Destructor

Member Function Documentation

AddCustomRequestHeader ( const TDesC8 &, const TDesC8 & )

IMPORT_C TIntAddCustomRequestHeader(const TDesC8 &aHeaderName,
const TDesC8 &aHeaderValue
)

This method facilitates to set the custom HTTP header once in the CHttpService instance that is applicable for all HTTP client transactions. [For ex; User-Agent header]

Parameters
aHeaderName- Custom header name
aHeaderValue- Value for the header

AddRequestHeader ( TInt, const THttpHeaderValueVariant & )

IMPORT_C TIntAddRequestHeader(TIntaHeaderId,
const THttpHeaderValueVariant &aHeaderValue
)

This method facilitates to set the header once in the CHttpService instance that is applicable for all HTTP client transactions. [For ex; User-Agent header]

Parameters
aHeaderId- Pre-defined String ID in the HTTP string pool
aHeaderValue- Value for the header

HttpNetworkConnection ( )

IMPORT_C CHttpNetworkConnection *HttpNetworkConnection()

returns the CHttpNetworkConnection instance created by the framework. The class can be used to set the connection properties.

MaxConnections ( )

IMPORT_C TIntMaxConnections()const

Returns the maximum no. of TCP connections that is set.

MaxTransactionsToPipeline ( )

IMPORT_C TIntMaxTransactionsToPipeline()const

Returns the maximum number of transactions to be pipelined.

NewL ( )

IMPORT_C CHttpService *NewL()[static]

The default 2-phase constructor to create a CHttpService instance

ProxyAddress ( )

IMPORT_C const TDesC8 &ProxyAddress()const

Returns the proxy address that is set

Return Value
Proxy address otherwise KNullDesC8 if the proxy information is not set.

SetAuthentication ( MHTTPServiceAuthentication * )

IMPORT_C TIntSetAuthentication(MHTTPServiceAuthentication *aCallback)

This method facilitates to set to construct the authentication credentials to be passed by the application The derived class from MHTTPServiceAuthentication will be called from the framework, if authentication is required.

Parameters
aCallback- Derived class from MHTTPServiceAuthentication

SetClientCredential ( const CX509Certificate &, const CDecPKCS8Data & )

IMPORT_C voidSetClientCredential(const CX509Certificate &aCertificate,
const CDecPKCS8Data &aPrivateKey
)

SetDialogMode ( const TDialogMode )

IMPORT_C TIntSetDialogMode(const TDialogModeaDialogMode)

To select the dialog mode.

Parameters
aDialogMode- enum value of type TDialogMode.
Return Value
- KErrNone in case of success, otherwise system-wide error code.

SetDialogSelection ( const TServerCertValidation )

IMPORT_C TIntSetDialogSelection(const TServerCertValidationaValidations)

To select the server certificate validation failure dialog to attend in HTTP::EDialogNoPrompt mode. Incase multiple validation selection, respective TServerCertValidation enums are logically ORed into single 32bit integer and provisioned.

Parameters
aValidations- Logically ORed enums of type TServerCertValidation.
Return Value
- KErrNone in case of success, otherwise system-wide error code.

SetMaxConnections ( TInt )

IMPORT_C voidSetMaxConnections(TIntaValue)

Set the maxuimum number of TCP connections[socket] CHttpService instance that can activated at any time. The default no. of connections that the CHttpService instance uses is 6.

Parameters
aValueaValue No. of connections

SetMaxTransactionsToPipeline ( TInt )

IMPORT_C voidSetMaxTransactionsToPipeline(TIntaValue)

Sets the maximum number of transactions to be pipelined.

Parameters
aValue- number of transactions

SetProxy ( const TDesC8 & )

IMPORT_C TIntSetProxy(const TDesC8 &aProxyAddress)

Set the proxy that applies to all HTTP client transactions that "this" CHttpService instance creates

Parameters
aProxyAddressProxy address. [for ex; http://myproxy.org:8081]
Return Value
KErrNoMemory if the proxy information cannot be set other KErrNone for success.

String ( TInt, TPtrC8 & )

IMPORT_C TIntString(TIntaStringId,
TPtrC8 &aPtr
)

Retrieves the equivalent string for a give string ID from the HTTP string pool

Parameters
aPtrString
Return Value
KErrNotFound if the string ID is not found in the HTTP string pool otherwise KErrNone for success