Results 1 to 9 of 9

Thread: QHttp Header formation -reg

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default QHttp Header formation -reg

    Hi,

    We are trying to build QHttp header to get google authentication, but we are ran into troubles while doing that. Can anybody suggest us where we were doing wrong? Please look at following code. Initially we tried with curl command line utility and we were able to get response from google. Just have look at below code..

    curl command (successfully got reply from google):
    /*
    Curl Command:
    curl https://google.com/accounts/ClientLogin HTTP/1.0
    -d Content-type=application/x-www-form-urlencoded
    -d Content-Length=121
    -d accountType=HOSTED_OR_GOOGLE
    -d Email="xxx@gmail.com"
    -d Passwd="xxx"
    -d service=lh2
    -d source="Blogger-1.0"
    -d UserAgent="Client"
    */

    code written in Qt:
    setHost("google.com",443);

    QHttpRequestHeader header("GET","/accounts/ClientLogin");
    header.setValue("Host","https://google.com");
    header.setValue("Port","443");
    header.setContentType("application/x-www-form-urlencoded");
    header.setValue("Content-Length", "121");
    header.setValue("accountType","HOSTED_OR_GOOGLE");
    header.setValue("Email","...@gmail.com");
    header.setValue("Passwd","...");
    header.setValue("service","lh2");
    header.setValue("source","Blogger-1.0");
    header.setValue("UserAgent","Client");

    int i = request(header,arr);
    qDebug()<<"request value = "<<i<<arr;

    connect(this,
    SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)),
    this,
    SLOT(displayData(const QHttpResponseHeader &)));
    connect(this,
    SIGNAL(stateChanged(int)),
    this,
    SLOT(displayStateValue(int)));
    connect(this,
    SIGNAL(requestFinished(int, bool)),
    this,
    SLOT(displayError(int, bool)));

    checking arr buffer after requestFinished signal was emitted!

    Thanks in advance.

    Regards,
    Developer
    Last edited by tietotesthyd; 30th April 2009 at 08:22.

Similar Threads

  1. How to edit Horizontal Header Item in QTableWidget
    By ioannis in forum Qt Programming
    Replies: 6
    Last Post: 5th March 2013, 18:50
  2. Howto : Header and Footers
    By pshah.mumbai in forum Qt Programming
    Replies: 0
    Last Post: 29th October 2008, 15:32
  3. How to customize horizontal header (diagonal header view)
    By vairamuthu.g in forum Qt Programming
    Replies: 4
    Last Post: 4th September 2008, 15:59
  4. From QHttp to QHttp over SSL
    By Nyphel in forum Newbie
    Replies: 1
    Last Post: 3rd July 2007, 10:41
  5. Replies: 0
    Last Post: 10th November 2006, 13:46

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.