Results 1 to 4 of 4

Thread: POST request - getting cookie

  1. #1
    Join Date
    Mar 2009
    Posts
    29
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default POST request - getting cookie

    Hi, I have a problem with sending request by POST method. I need to obtain this kind of values:
    Qt Code:
    1. [truncated] Cookie: PHPSESSID=ob2ruo5p0dkl4rka8gebalkjf5; __utmc=1; __utma=1.789422630.1347752739.1347752739.1347752739.1; __utmb=1.1.10.1347752739; __utmz=1.1347752739.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=122885273; _
    To copy to clipboard, switch view to plain text mode 
    to send correct request. How do I get it? I use QNetworkAccessManager class to communicate with server, and checking requests by Whireshark where i found only this difference between original request and genereted by me. The server reply is: "Content-encoded entity body (gzip): 20 bytes [Error: Decompression failed]". Thanks in advance.

  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: POST request - getting cookie

    These are cookies. The server should have sent you some response to an earlier request with "Set-Cookie" header containing those values.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    Trok (16th September 2012)

  4. #3
    Join Date
    Mar 2009
    Posts
    29
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: POST request - getting cookie

    Thanks for your help. I received value of "Set-Cookie" now, but it contains just PHPSESSID, without remaining fields (__utmc, __utma etc.). When fill new header with this value, result is still the same. Where can i find the rest of this fields?

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: POST request - getting cookie

    Each of those "fields" is a separate cookie. If the server did not send them to you then they don't exist and QNetworkAccessManager cannot return them with later requests. In the case of the __utma through __utmz cookies they are from Google Analytics and probably will not be set unless you execute the Javascript Google urchin in the returned page.
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

Similar Threads

  1. ASP .NET - POST request method
    By Trok in forum Qt Programming
    Replies: 3
    Last Post: 6th October 2011, 22:52
  2. HTTP request POST in QT application
    By abdul_moiz in forum Newbie
    Replies: 5
    Last Post: 24th June 2011, 03:48
  3. Request ID of QNetworkaccessmanager get and post request
    By dineshkumar in forum Qt Programming
    Replies: 2
    Last Post: 4th February 2011, 21:56
  4. POST request to a web service
    By QPlace in forum Qt Programming
    Replies: 3
    Last Post: 6th November 2008, 08:05
  5. Https POST Request
    By munna in forum Qt Programming
    Replies: 10
    Last Post: 11th November 2006, 14:24

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.