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

  • CHttpClientTransaction
Public Member Functions
~CHttpClientTransaction()
IMPORT_C TIntAddCustomRequestHeader(const TDesC8 &, const TDesC8 &)
IMPORT_C TIntAddRequestHeader(TInt, const THttpHeaderValueVariant &)
IMPORT_C TIntAddRequestHeader(TInt, const THttpHeaderValueVariant &, TInt, const THttpHeaderValueVariant &)
IMPORT_C TIntAddRequestHeader(const TDesC8 &, const THttpHeaderValueVariant &)
IMPORT_C TIntAddRequestHeader(const TDesC8 &, const THttpHeaderValueVariant &, const TDesC8 &, const THttpHeaderValueVariant &)
IMPORT_C TIntAddRequestHeader(const TDesC8 &, const TDesC8 &, const THttpHeaderValueVariant &)
IMPORT_C voidCancelRequest()
IMPORT_C TIntCreate(CHttpService &, const TDesC8 &, const TDesC8 &)
IMPORT_C voidDisablePipelining()
voidOnCompletion()
voidOnError(TInt)
IMPORT_C TBoolOnRedirection()
voidOnResponseHeaders()
IMPORT_C voidOnTransferProgress(TInt, TInt)
IMPORT_C voidOnWarning(TInt)
IMPORT_C THttpHeaderElementIteratorResponseHeader(TInt)
IMPORT_C THttpHeaderElementIteratorResponseHeader(const TDesC8 &)
IMPORT_C THttpHeaderIteratorResponseHeaders()
IMPORT_C TIntSendRequest()
IMPORT_C TIntSetContentSink(MHttpContentSink &)
IMPORT_C TIntSetContentSink(RFile &)
IMPORT_C TIntSetContentSource(MHttpContentSource &)
IMPORT_C TIntSetContentSource(RFile &)
IMPORT_C voidSetNoRetry()
IMPORT_C voidSetRequestTimeout(TInt)
IMPORT_C voidSetResponseTimeout(TInt)
IMPORT_C TIntStatusCode()
IMPORT_C const TDesC8 &StatusText()
Protected Member Functions
CHttpClientTransaction()
Private Member Functions
voidReserved1()
voidReserved2()
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_CCHttpClientTransaction()[protected]

~CHttpClientTransaction()

IMPORT_C~CHttpClientTransaction()[virtual]

Destructor

Member Functions Documentation

AddCustomRequestHeader(const TDesC8 &, const TDesC8 &)

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

Parameters

const TDesC8 & aHeaderName
const TDesC8 & aHeaderValue

AddRequestHeader(TInt, const THttpHeaderValueVariant &)

IMPORT_C TIntAddRequestHeader(TIntaHeaderId,
const THttpHeaderValueVariant &aHeaderValue
)

Parameters

TInt aHeaderId
const THttpHeaderValueVariant & aHeaderValue

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

IMPORT_C TIntAddRequestHeader(TIntaHeaderId,
const THttpHeaderValueVariant &aHeaderValue,
TIntaParamId,
const THttpHeaderValueVariant &aParamValue
)

Parameters

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

AddRequestHeader(const TDesC8 &, const THttpHeaderValueVariant &)

IMPORT_C TIntAddRequestHeader(const TDesC8 &aHeaderName,
const THttpHeaderValueVariant &aHeaderValue
)

Parameters

const TDesC8 & aHeaderName
const THttpHeaderValueVariant & aHeaderValue

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

IMPORT_C TIntAddRequestHeader(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 TIntAddRequestHeader(const TDesC8 &aHeaderName,
const TDesC8 &aParamName,
const THttpHeaderValueVariant &aParamValue
)

Parameters

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

CancelRequest()

IMPORT_C voidCancelRequest()

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

IMPORT_C TIntCreate(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 voidDisablePipelining()

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()

voidOnCompletion()[pure virtual]

OnError(TInt)

voidOnError(TIntaError)[pure virtual]

Parameters

TInt aError

OnRedirection()

IMPORT_C TBoolOnRedirection()[virtual]

OnResponseHeaders()

voidOnResponseHeaders()[pure virtual]

virtual functions

OnTransferProgress(TInt, TInt)

IMPORT_C voidOnTransferProgress(TIntaTotal,
TIntaTransffered
)[virtual]

virtual functions

Parameters

TInt aTotal
TInt aTransffered

OnWarning(TInt)

IMPORT_C voidOnWarning(TIntaWarning)[virtual]

Parameters

TInt aWarning

Reserved1()

voidReserved1()[private, inline, virtual]

Reserved2()

voidReserved2()[private, inline, virtual]

ResponseHeader(TInt)

IMPORT_C THttpHeaderElementIteratorResponseHeader(TIntaHeaderId)

Parameters

TInt aHeaderId

ResponseHeader(const TDesC8 &)

IMPORT_C THttpHeaderElementIteratorResponseHeader(const TDesC8 &aHeaderName)

Parameters

const TDesC8 & aHeaderName

ResponseHeaders()

IMPORT_C THttpHeaderIteratorResponseHeaders()const

SendRequest()

IMPORT_C TIntSendRequest()

SetContentSink(MHttpContentSink &)

IMPORT_C TIntSetContentSink(MHttpContentSink &aSink)

Set the dynamic HTTP content sink

Parameters

MHttpContentSink & aSink

SetContentSink(RFile &)

IMPORT_C TIntSetContentSink(RFile &aFile)

Set the static HTTP content sink

Parameters

RFile & aFile- An opened file

SetContentSource(MHttpContentSource &)

IMPORT_C TIntSetContentSource(MHttpContentSource &aSource)

Set the dynamic HTTP content source.

Parameters

MHttpContentSource & aSource

SetContentSource(RFile &)

IMPORT_C TIntSetContentSource(RFile &aFile)

Set the static HTTP content source.

Parameters

RFile & aFile- An opened file

SetNoRetry()

IMPORT_C voidSetNoRetry()

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

SetRequestTimeout(TInt)

IMPORT_C voidSetRequestTimeout(TIntaValue)

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 voidSetResponseTimeout(TIntaValue)

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 TIntStatusCode()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]