Results 1 to 11 of 11

Thread: QNetworkRequest https problem connect missing reply

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QNetworkRequest https problem connect missing reply

    Hello I create this thread because i dont find solution for my problem.

    I want to connect in this web site and take cookies: https://cas.univ-ubs.fr/login

    my CookieJar class write in a file all cookies of the reply but they have nothing with this website.

    Qt Code:
    1. void FenPrincipale::takeCookies()
    2. {
    3. QUrl postData;
    4. postData.addQueryItem("username","user101");
    5. postData.addQueryItem("password",var2_Edit->text());
    6. postData.addQueryItem("warn", "true");
    7. postData.addQueryItem("lt", lt);
    8. postData.addQueryItem("_eventId", "submit");
    9. postData.addQueryItem("submit", "SE CONNECTER");
    10.  
    11. // On crée une requête
    12. QNetworkRequest requete(QUrl(urlEdit1->text()));
    13.  
    14. requete.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
    15. r = m->post(requete, postData.encodedQuery());
    16.  
    17.  
    18. // Gestion des erreurs
    19. connect(r, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(messageErreur(QNetworkReply::NetworkError)));
    20. // Gestion de fin de téléchargement
    21. connect(r, SIGNAL(finished()), this, SLOT(takeLink()));
    22. }
    23.  
    24. // The second slot for the reply
    25. void FenPrincipale::takeLink()
    26. {
    27. QNetworkReply *reply = static_cast<QNetworkReply*>(sender());
    28. QNetworkAccessManager *m = reply->manager();
    29. m->setCookieJar(new CookieJar(this));
    30.  
    31. qDebug() << reply->readAll();
    32. }
    To copy to clipboard, switch view to plain text mode 

    Thanks in advance.
    Last edited by wysota; 10th September 2010 at 20:28. Reason: missing [code] tags

Similar Threads

  1. Replies: 0
    Last Post: 3rd August 2010, 10:07
  2. Compiler error when calling QObject::connect. What am I missing?
    By themanwiththequestion in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2010, 15:33
  3. Issue using connect, what am I missing?
    By technoViking in forum Qt Programming
    Replies: 1
    Last Post: 11th January 2010, 06:11
  4. QReply HTTPS problem
    By Tanuki-no Torigava in forum Qt Programming
    Replies: 0
    Last Post: 12th September 2009, 09:26
  5. QNetworkRequest file upload -- please help
    By Runtime Technologies in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2009, 16:55

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
  •  
Qt is a trademark of The Qt Company.