tags:

views:

38

answers:

1

I need to intercept the submitted transactions in my app, so i can inject on them previously stored cookies.
But the THTTPEvent::ESubmit is never fired. (Tested with a breakpoint on Debug using Carbide C++)
The code of the Event Handler is this:

void CHttpEventHandler::MHFRunL(RHTTPTransaction aTransaction,
        const THTTPEvent& aEvent)
    {
    switch (aEvent.iStatus)
        {
        case THTTPEvent::ESubmit:
            {
            //This CASE is never executed!
            User::InfoPrint(_L("Submitting Transaction!"));
            //TODO : Inject cookies in header =)
            }
            break;
        } // end switch
    }
+2  A: 

You can set request header values before submitting the transaction in the first place.

Get the RHTTPHeaders handle with transaction.Request().GetHeaderCollection() and then use SetFieldL() calls to add Cookie: foo=bar request header fields.

laalto