Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor kiranpuranik's Avatar
    Join Date
    Feb 2004
    Posts
    99
    Hi All,

    I am trying to access a HTTP header. but I am not able to succeed. I am trying to access the "Set-Cookie" header sent by my server.

    RHTTPResponse resp = aTransaction.Response();
    RStringPool strP = aTransaction.Session().StringPool();
    RHTTPHeaders hdr = resp.GetHeaderCollection();
    RStringF fieldNameStr = strP.OpenFStringL(_L8("Set-Cookie"));
    THTTPHdrVal fieldVal;

    if (hdr.GetField(fieldNameStr,0,fieldVal) == KErrNone)
    {
    RStringF fieldValStr = strP.StringF(fieldVal.StrF());
    TDesC8& val = (TDesC8&)fieldValStr.DesC();
    HBufC* buf = HBufC::NewL(100);
    buf->Des().Copy(val);
    delete buf;
    }

    Now .. the "buf" I am getting is nowhere what my server is sending .. its sending me a cookie .. which is a very long string of alphanumeric characters .. but what I get is "Cookie" . .a single word ..

    can someone please find the issue in the above code.

    thanks a lot in advance.

    ..
    KiraN Puranik.

  2. #2
    Super Contributor Paul.Todd's Avatar
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644
    USe THTTPHdrVal to extract the value as the value can be a number of types

    See http://developer.uiq.com/devlib/uiq_...ers.guide.html for a better set of examples

  3. #3
    Regular Contributor anand_zain76's Avatar
    Join Date
    Mar 2006
    Location
    India
    Posts
    138
    Quote Originally Posted by Paul.Todd View Post
    USe THTTPHdrVal to extract the value as the value can be a number of types

    See http://developer.uiq.com/devlib/uiq_...ers.guide.html for a better set of examples
    Hi Paul,
    I am also facing the same problem.
    Could u plz help me out.
    Thanks
    Anand

  4. #4
    Regular Contributor lucky@symbian's Avatar
    Join Date
    Jul 2007
    Location
    Bangalore
    Posts
    91
    Hi.
    Try this.

    RHTTPResponse resp = aTransaction.Response();
    RHTTPHeaders respHeader = resp .GetHeaderCollection();
    HTTPHdrFieldIter itr = respHeader.Fields();
    RStringPool strPool = aTransaction.Session().StringPool();
    itr .First();

    //now iterate thru the entire header and keep collecting data

    //once you have the entire header info in a descriptor may be parse it.
    Cheers
    Subhasis

Similar Threads

  1. Recording in Amr Format
    By losym in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2009-03-26, 06:41
  2. [ help ] how to add cookie in http request header
    By cysnew in forum Symbian C++
    Replies: 6
    Last Post: 2008-05-15, 07:55
  3. Custom HTTP Header Name in POST Request
    By srigans1 in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-08-25, 06:56
  4. HTTP header
    By xrsu in forum General Messaging
    Replies: 1
    Last Post: 2002-12-11, 08:11
  5. HTTP header and WAP209 header equivalence/precedence/conf licts
    By mobilecohesion in forum General Messaging
    Replies: 0
    Last Post: 2002-12-03, 11:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved