×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    22

    [moved] NO RESPONSE IN HTTP POST USING QNETWORK ACCESS MANAGER

    url post request
    Last edited by karthick9686; 2011-04-29 at 06:49.

  2. #2
    Registered User
    Join Date
    Apr 2011
    Posts
    22

    PROBLEM IN PERFORMING HTTP URL POST AND DISPLAYING THE REPLY

    how to make an http post request
    Last edited by karthick9686; 2011-04-29 at 06:48.

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    45

    Re: [moved] NO RESPONSE IN HTTP POST USING QNETWORK ACCESS MANAGER

    You've got the answer, but you don't wait for the response. You need to wait for QNetworkManager or QNetworkReply finished() signal. So, I write down what you need to change:

    void MainWindow:n_pushButton_clicked()
    {
    QNetworkAccessManager *nwam = new QNetworkAccessManager(this);
    connect(nwam, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*)));

    QNetworkRequest request(QUrl(URL));
    request.setHeader(QNetworkRequest::ContentTypeHeader,"application/x-www-form-urlencoded");

    QByteArray data;
    data.append(POST);

    qDebug()<<data;
    QNetworkReply *reply = nwam->post(request,data);
    }

    void MainWindow::replyFinished(QNetworkReply* reply)
    {
    QByteArray response = reply->readAll();

    qDebug()<<response;

    qDebug()<<"finished";
    }

    You have connected the QNetworkManager's signal to replyFinished(QNetworkReply*) slot, but not implemented the method

    If you want to bulid to device, you need add this line in your .pro file : QT += network
    Last edited by chriske86; 2011-04-29 at 07:13.

  4. #4
    Registered User
    Join Date
    Apr 2011
    Posts
    22

    Re: [moved] NO RESPONSE IN HTTP POST USING QNETWORK ACCESS MANAGER

    how to perform url post request
    Last edited by karthick9686; 2011-04-29 at 06:46.

  5. #5
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: [moved] NO RESPONSE IN HTTP POST USING QNETWORK ACCESS MANAGER

    Are you sure that submit[auth_key] is a valid data to pass to the server?
    Also you may want to check QNetworkReply::errorString().

  6. #6
    Registered User
    Join Date
    Apr 2011
    Posts
    22

    Re: [moved] NO RESPONSE IN HTTP POST USING QNETWORK ACCESS MANAGER

    the problem is not solved yet. I am facing the same problem . i am getting an empty string as a QNetwokReply

  7. #7
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: [moved] NO RESPONSE IN HTTP POST USING QNETWORK ACCESS MANAGER

    Are u behind a proxy?

Similar Threads

  1. Using HTTP POST, if APN setting use proxy, I not get the response
    By Kaz32 in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2011-05-10, 13:03
  2. Http Post request response
    By anoopd in forum Symbian Networking & Messaging (Closed)
    Replies: 5
    Last Post: 2010-02-27, 14:12
  3. [moved] Why the difference in response using HTTP Api's and RSocket API's?
    By newbie2201 in forum Symbian Networking & Messaging (Closed)
    Replies: 8
    Last Post: 2010-02-19, 18:39
  4. waiting for HTTP POST response
    By gemilib in forum Symbian
    Replies: 3
    Last Post: 2007-11-19, 17:00
  5. getting response in http post
    By sangeethavijaysekar in forum Symbian
    Replies: 4
    Last Post: 2007-04-26, 09:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×