CHttpClientTransaction Class Reference

#include <mw/chttpclienttransaction.h>

Link against: httpservice.lib

class CHttpClientTransaction : public CBase

Inherits from

  • CHttpClientTransaction
    Public Member Functions
    virtual ~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()
    pure virtual voidOnCompletion()
    pure virtual voidOnError(TInt)
    virtual IMPORT_C TBoolOnRedirection()
    pure virtual voidOnResponseHeaders()
    virtual IMPORT_C voidOnTransferProgress(TInt, TInt)
    virtual 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()
    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()

    Detailed Description

    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..]

    Constructor & Destructor Documentation

    CHttpClientTransaction ( )

    IMPORT_CCHttpClientTransaction()[protected]

    ~CHttpClientTransaction ( )

    IMPORT_C~CHttpClientTransaction()[virtual]

    Destructor

    Member Function Documentation

    AddCustomRequestHeader ( const TDesC8 &, const TDesC8 & )

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

    AddRequestHeader ( TInt, const THttpHeaderValueVariant & )

    IMPORT_C TIntAddRequestHeader(TIntaHeaderId,
    const THttpHeaderValueVariant &aHeaderValue
    )

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

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

    AddRequestHeader ( const TDesC8 &, const THttpHeaderValueVariant & )

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

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

    IMPORT_C TIntAddRequestHeader(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

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

    Returns: KErrNoMemory incase of failure otherwise KErrNone for success

    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]

    OnRedirection ( )

    IMPORT_C TBoolOnRedirection()[virtual]

    OnResponseHeaders ( )

    voidOnResponseHeaders()[pure virtual]

    virtual functions

    OnTransferProgress ( TInt, TInt )

    IMPORT_C voidOnTransferProgress(TIntaTotal,
    TIntaTransffered
    )[virtual]

    virtual functions

    OnWarning ( TInt )

    IMPORT_C voidOnWarning(TIntaWarning)[virtual]

    ResponseHeader ( TInt )

    IMPORT_C THttpHeaderElementIteratorResponseHeader(TIntaHeaderId)

    ResponseHeader ( const TDesC8 & )

    IMPORT_C THttpHeaderElementIteratorResponseHeader(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

    SetContentSink ( RFile & )

    IMPORT_C TIntSetContentSink(RFile &aFile)

    Set the static HTTP content sink

    ParameterDescription
    aFile- An opened file

    SetContentSource ( MHttpContentSource & )

    IMPORT_C TIntSetContentSource(MHttpContentSource &aSource)

    Set the dynamic HTTP content source.

    SetContentSource ( RFile & )

    IMPORT_C TIntSetContentSource(RFile &aFile)

    Set the static HTTP content source.

    ParameterDescription
    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

    ParameterDescription
    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

    StatusCode ( )

    IMPORT_C TIntStatusCode()const

    Returns HTTP response status code

    StatusText ( )

    IMPORT_C const TDesC8 &StatusText()const

    Returns HTTP response status text