CHttpClientTransaction Class Reference

class CHttpClientTransaction : public CBase

In HTTP terms a single transaction is one request and its equivalent response. CHttpClientTransaction encapsulates the information for the transaction. The client transaction is associated with the client session. Client should derive from this class and implement the concrete use cases. [for ex; download, upload etc..]

Inherits from

Public Member Functions
~CHttpClientTransaction ()
IMPORT_C TInt AddCustomRequestHeader (const TDesC8 &, const TDesC8 &)
IMPORT_C TInt AddRequestHeader ( TInt , const THttpHeaderValueVariant &)
IMPORT_C TInt AddRequestHeader ( TInt , const THttpHeaderValueVariant &, TInt , const THttpHeaderValueVariant &)
IMPORT_C TInt AddRequestHeader (const TDesC8 &, const THttpHeaderValueVariant &)
IMPORT_C TInt AddRequestHeader (const TDesC8 &, const THttpHeaderValueVariant &, const TDesC8 &, const THttpHeaderValueVariant &)
IMPORT_C TInt AddRequestHeader (const TDesC8 &, const TDesC8 &, const THttpHeaderValueVariant &)
IMPORT_C void CancelRequest ()
IMPORT_C TInt Create ( CHttpService &, const TDesC8 &, const TDesC8 &)
IMPORT_C void DisablePipelining ()
void OnCompletion ()
void OnError ( TInt )
IMPORT_C TBool OnRedirection ()
void OnResponseHeaders ()
IMPORT_C void OnTransferProgress ( TInt , TInt )
IMPORT_C void OnWarning ( TInt )
IMPORT_C THttpHeaderElementIterator ResponseHeader ( TInt )
IMPORT_C THttpHeaderElementIterator ResponseHeader (const TDesC8 &)
IMPORT_C THttpHeaderIterator ResponseHeaders ()
IMPORT_C TInt SendRequest ()
IMPORT_C TInt SetContentSink ( MHttpContentSink &)
IMPORT_C TInt SetContentSink ( RFile &)
IMPORT_C TInt SetContentSource ( MHttpContentSource &)
IMPORT_C TInt SetContentSource ( RFile &)
IMPORT_C void SetNoRetry ()
IMPORT_C void SetRequestTimeout ( TInt )
IMPORT_C void SetResponseTimeout ( TInt )
IMPORT_C TInt StatusCode ()
IMPORT_C const TDesC8 & StatusText ()
Protected Member Functions
CHttpClientTransaction ()
Private Member Functions
void Reserved1 ()
void Reserved2 ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
CHttpClientTransactionImpl * iHttpClientTrans

Constructor & Destructor Documentation

CHttpClientTransaction()

IMPORT_C CHttpClientTransaction ( ) [protected]

~CHttpClientTransaction()

IMPORT_C ~CHttpClientTransaction ( ) [virtual]

Destructor

Member Functions Documentation

AddCustomRequestHeader(const TDesC8 &, const TDesC8 &)

IMPORT_C TInt AddCustomRequestHeader ( const TDesC8 & aHeaderName,
const TDesC8 & aHeaderValue
)

Parameters

const TDesC8 & aHeaderName
const TDesC8 & aHeaderValue

AddRequestHeader(TInt, const THttpHeaderValueVariant &)

IMPORT_C TInt AddRequestHeader ( TInt aHeaderId,
const THttpHeaderValueVariant & aHeaderValue
)

Parameters

TInt aHeaderId
const THttpHeaderValueVariant & aHeaderValue

AddRequestHeader(TInt, const THttpHeaderValueVariant &, TInt, const THttpHeaderValueVariant &)

IMPORT_C TInt AddRequestHeader ( TInt aHeaderId,
const THttpHeaderValueVariant & aHeaderValue,
TInt aParamId,
const THttpHeaderValueVariant & aParamValue
)

Parameters

TInt aHeaderId
const THttpHeaderValueVariant & aHeaderValue
TInt aParamId
const THttpHeaderValueVariant & aParamValue

AddRequestHeader(const TDesC8 &, const THttpHeaderValueVariant &)

IMPORT_C TInt AddRequestHeader ( const TDesC8 & aHeaderName,
const THttpHeaderValueVariant & aHeaderValue
)

Parameters

const TDesC8 & aHeaderName
const THttpHeaderValueVariant & aHeaderValue

AddRequestHeader(const TDesC8 &, const THttpHeaderValueVariant &, const TDesC8 &, const THttpHeaderValueVariant &)

IMPORT_C TInt AddRequestHeader ( const TDesC8 & aHeaderName,
const THttpHeaderValueVariant & aHeaderValue,
const TDesC8 & aParamName,
const THttpHeaderValueVariant & aParamValue
)

Parameters

const TDesC8 & aHeaderName
const THttpHeaderValueVariant & aHeaderValue
const TDesC8 & aParamName
const THttpHeaderValueVariant & aParamValue

AddRequestHeader(const TDesC8 &, const TDesC8 &, const THttpHeaderValueVariant &)

IMPORT_C TInt AddRequestHeader ( const TDesC8 & aHeaderName,
const TDesC8 & aParamName,
const THttpHeaderValueVariant & aParamValue
)

Parameters

const TDesC8 & aHeaderName
const TDesC8 & aParamName
const THttpHeaderValueVariant & aParamValue

CancelRequest()

IMPORT_C void CancelRequest ( )

Create(CHttpService &, const TDesC8 &, const TDesC8 &)

IMPORT_C TInt Create ( CHttpService & aClient,
const TDesC8 & aMethod,
const TDesC8 & aUri
)

Create the HTTP transaction by specifiying the method [GET, POST etc..] and a URI

Parameters

CHttpService & aClient - CHttpService instance
const TDesC8 & aMethod - HTTP method. [GET, POST etc...]
const TDesC8 & aUri - URI

DisablePipelining()

IMPORT_C void DisablePipelining ( )

Disable the pipelining for this transaction. The transaction will be send on a free TCP connection and no other transactions will be send via that TCP connection till the response for this transaction is received

OnCompletion()

void OnCompletion ( ) [pure virtual]

OnError(TInt)

void OnError ( TInt aError ) [pure virtual]

Parameters

TInt aError

OnRedirection()

IMPORT_C TBool OnRedirection ( ) [virtual]

OnResponseHeaders()

void OnResponseHeaders ( ) [pure virtual]

virtual functions

OnTransferProgress(TInt, TInt)

IMPORT_C void OnTransferProgress ( TInt aTotal,
TInt aTransffered
) [virtual]

virtual functions

Parameters

TInt aTotal
TInt aTransffered

OnWarning(TInt)

IMPORT_C void OnWarning ( TInt aWarning ) [virtual]

Parameters

TInt aWarning

Reserved1()

void Reserved1 ( ) [private, inline, virtual]

Reserved2()

void Reserved2 ( ) [private, inline, virtual]

ResponseHeader(TInt)

IMPORT_C THttpHeaderElementIterator ResponseHeader ( TInt aHeaderId )

Parameters

TInt aHeaderId

ResponseHeader(const TDesC8 &)

IMPORT_C THttpHeaderElementIterator ResponseHeader ( const TDesC8 & aHeaderName )

Parameters

const TDesC8 & aHeaderName

ResponseHeaders()

IMPORT_C THttpHeaderIterator ResponseHeaders ( ) const

SendRequest()

IMPORT_C TInt SendRequest ( )

SetContentSink(MHttpContentSink &)

IMPORT_C TInt SetContentSink ( MHttpContentSink & aSink )

Set the dynamic HTTP content sink

Parameters

MHttpContentSink & aSink

SetContentSink(RFile &)

IMPORT_C TInt SetContentSink ( RFile & aFile )

Set the static HTTP content sink

Parameters

RFile & aFile - An opened file

SetContentSource(MHttpContentSource &)

IMPORT_C TInt SetContentSource ( MHttpContentSource & aSource )

Set the dynamic HTTP content source.

Parameters

MHttpContentSource & aSource

SetContentSource(RFile &)

IMPORT_C TInt SetContentSource ( RFile & aFile )

Set the static HTTP content source.

Parameters

RFile & aFile - An opened file

SetNoRetry()

IMPORT_C void SetNoRetry ( )

Disable automatic retry on a TCP connection failure. On TCP connection failure the error will be notified via OnError function

SetRequestTimeout(TInt)

IMPORT_C void SetRequestTimeout ( TInt aValue )

Set the HTTP request timeout. If the HTTP request didn't send in the specified time OnError will be called with an error code

Parameters

TInt aValue - Request timeout value

SetResponseTimeout(TInt)

IMPORT_C void SetResponseTimeout ( TInt aValue )

Set the HTTP response timeout. If the HTTP response didn't arrive in the specified time OnError will be called with an error code

Parameters

TInt aValue

StatusCode()

IMPORT_C TInt StatusCode ( ) const

Returns HTTP response status code

StatusText()

IMPORT_C const TDesC8 & StatusText ( ) const

Returns HTTP response status text

Member Data Documentation

CHttpClientTransactionImpl * iHttpClientTrans

CHttpClientTransactionImpl * iHttpClientTrans [private]