Results 1 to 2 of 2

Thread: Multiple names and values in QNetworkCookie

  1. #1
    Join Date
    Apr 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Multiple names and values in QNetworkCookie

    Hello,
    don't someone know how to make QNetworkRequest with QNetworkCookie which contains 2 names and values??.. So the request header will be Cookie name1=value1; name2=value2 .. I know ho to do it with one name and value, but I don't really have an idea how to solve my problem.. Thank you..

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Multiple names and values in QNetworkCookie

    Qt Code:
    1. QNetworkRequest req(...)
    2. QNetworkCookie cookie1("name1", "value1");
    3. QNetworkCookie cookie2("name2", "value2");
    4. QList<QNetworkCookie> cookies;
    5. cookies << cookie1 << cookie2;
    6. req.setHeader(QNetworkRequest::CookieHeader, cookies);
    To copy to clipboard, switch view to plain text mode 

    If you really need both cookies be set on the same header call, use QNetworkRequest::setRawHeader() just don't mix it with setHeader().

Similar Threads

  1. Replies: 2
    Last Post: 6th October 2010, 22:09
  2. How to get multiple lines values in XML file..
    By dark1988 in forum Qt Programming
    Replies: 3
    Last Post: 22nd July 2008, 08:24
  3. Custom names for Qt libraries?
    By Eldritch in forum Installation and Deployment
    Replies: 8
    Last Post: 16th October 2007, 01:44
  4. Qt causes conflicting function names
    By thomaspu in forum Qt Programming
    Replies: 6
    Last Post: 14th September 2007, 15:30
  5. moc with same file names?
    By cjhuitt in forum Qt Programming
    Replies: 9
    Last Post: 27th April 2007, 20:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.