Results 1 to 7 of 7

Thread: QHttp RequestStarted does not even begin!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Posts
    30
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Question QHttp RequestStarted does not even begin!

    I set up my project, using QT += network

    It's a static app and I included QtNetwork.

    I made sure all the connections are connected... no problems there...

    Qt Code:
    1. connect(http, SIGNAL(stateChanged(int)), this, SLOT(DisplayProgress(int)));
    2. connect(http, SIGNAL(requestFinished(int, bool)), this, SLOT(httpRequestFinished(int, bool)));
    3. connect(http, SIGNAL(requestStarted (int)), this, SLOT(httpRequestStarted(int)));
    4. connect(http, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int)));
    5. connect(http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), this, SLOT(readResponseHeader(const QHttpResponseHeader &)));
    To copy to clipboard, switch view to plain text mode 

    Neither get(), nor post() has any problem executing. But after that everything seems to go silent.

    Like as if the signals aren't working at all.

    I put logs everywhere, and not a single connected signal is being emitted. requestStarted doesn't even begin.

    I made sure to follow the example in QHttp. I simply put up a GET for a PHP page online. I am online, firewall is off and everything (though it is vista).

    Qt Code:
    1. void httpRequestStarted(int id){
    2. if(id == httpPostId){
    3. Log2("Started");
    4. } else if (id == httpGetId){
    5. Log2("Started");
    6. }
    7. Log2("Req Started");
    8. }
    To copy to clipboard, switch view to plain text mode 

    But nothing is getting logged.
    Apparently, either QtNetwork isn't working, or neither get nor post activates httpRequestStarted.

    I declared http as a QHttp(this) (this being a QObject class).

    The logs just stop here and here:
    Qt Code:
    1. void cConnect::PostRead(QString data, const QString& siteurl, int encrypt){
    2. //data = Encrypt(data);
    3. httpRequestAborted = false;
    4. httpPostId = http->post(QUrl::toPercentEncoding(siteurl), data.toAscii());
    5. }
    To copy to clipboard, switch view to plain text mode 

    This is for GET:
    Qt Code:
    1. httpRequestAborted = false;
    2. httpGetId = http->get(QUrl::toPercentEncoding(Url), file);
    3. Log2("CC::Downloading File");
    To copy to clipboard, switch view to plain text mode 

    How can this be? I never declared a "Host" and I never get the signal for requestStart().
    Last edited by Arsenic; 7th August 2008 at 22:14.

Similar Threads

  1. From QHttp to QHttp over SSL
    By Nyphel in forum Newbie
    Replies: 1
    Last Post: 3rd July 2007, 10:41

Tags for this Thread

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.