nokia的HTTP例子,添加自定义协议头


void CDXClientEngine::SetHeaderL(RHTTPHeaders aHeaders, TDesC8 aHdrField,
        const TDesC8& aHdrValue)
{
    RStringF valStr = iSession.StringPool().OpenFStringL(aHdrValue);
    HBufC8 * pField = aHdrField.AllocL();
    RStringF rHdrField = iSession.StringPool().OpenFStringL(*pField);
    CleanupClosePushL(valStr);
    THTTPHdrVal val(valStr);
    aHeaders.SetFieldL(rHdrField, val);
    CleanupStack::PopAndDestroy(); // valStr
    rHdrField.Close();   
    delete pField;
}


调用方法:
SetHeaderL(hdr, _L8("sessionID"), aSessionID);

你可能感兴趣的:(delete,Nokia)