Results 1 to 2 of 2

Thread: Fail use QNetworkAccessManager to implement goole account login

  1. #1
    Join Date
    Feb 2010
    Posts
    12
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Question Fail use QNetworkAccessManager to implement goole account login

    Hi, I did a demo using QNetworkAccessManager to post a request to google account authentication url
    https://www.google.com/accounts/ClientLogin
    with my email and password .etc as request body, but I always got the reply status code 0,normally the satus
    code is 200

    The parameter used in authentication is located at
    http://code.google.com/apis/accounts...alledApps.html


    The practice is more or less like this,

    QNetworkRequest* request = new QNetworkRequest(QUrl("https://www.google.com/accounts/ClientLogin"));
    QByteArray content = "EMAIL=***&Passwd=***&service=cl&source=***&accoun tType=***";
    request->setHeader(QNetworkRequest::ContentTypeHeader,"app lication/x-www-form-urlencoded");
    networkAccessManager->post(*request, content);


    and In onFinished(QNetworkReply* reply) slot, I get reply status code by
    reply->attribute(QNetworkRequest::HttpStatusCodeAttribut e).toInt();

    The status code of reply is always 0. I don't know why, normally the status code should be 200. and if I modify the https to http, the reply status code turn to 302 means redirection, this seems correct.

  2. #2
    Join Date
    Feb 2010
    Posts
    12
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Fail use QNetworkAccessManager to implement goole account login

    Somebody help me, thanks a lot.

Similar Threads

  1. How to Login using QNetworkAccessManager?
    By cydside in forum Newbie
    Replies: 1
    Last Post: 31st August 2009, 21:41
  2. Replies: 0
    Last Post: 30th August 2009, 15:18
  3. Qt & Goole Maps
    By codeman in forum Qt Programming
    Replies: 1
    Last Post: 17th June 2009, 16:34
  4. password for 'root' account in Greenphone
    By rishiraj in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 27th April 2009, 05:42

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.