Results 1 to 3 of 3

Thread: QNetworkAccessManager and QHttp doesn't sends anything

  1. #1
    Join Date
    Apr 2010
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QNetworkAccessManager and QHttp doesn't sends anything

    Hi everyone,

    i wrote some app and trying with a help of QNetworkAccessManager send some data to server using POST request, however nothing happen at all. I tried to use QHttp and the same result. I have checked it with WireShark - none requests in the list from my program. I tried to send GET request and the same - none requests. I created project with Network libs, got example from help:

    manager = new QNetworkAccessManager(this);
    connect(manager, SIGNAL(finished(QNetworkReply*)),
    this, SLOT(requesReply(QNetworkReply*)));

    QNetworkRequest req;
    req.setUrl(QUrl("http://server.net/upload"));
    manager->get(req);

    Please help me to find what i'm missing.

    Thanks in advance

  2. #2
    Join Date
    May 2010
    Posts
    24
    Thanked 8 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkAccessManager and QHttp doesn't sends anything

    Did you test to see if there was an error ?
    Qt Code:
    1. void YourClass::requesReply(QNetworkReply* reply)
    2. {
    3. reply->deleteLater();
    4. if (reply->error() != QNetworkReply::NoError)
    5. {
    6. QMessageBox::critical(0, "NetworkError", reply->errorString());
    7. return;
    8. }
    9. ...
    10. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QNetworkAccessManager and QHttp doesn't sends anything

    "Server.net" does not have an address record?

Similar Threads

  1. QNetworkAccessManager doesn't work
    By Floppy in forum Newbie
    Replies: 7
    Last Post: 14th November 2009, 16:32
  2. QNetworkAccessManager or QHttp
    By mind_freak in forum Qt Programming
    Replies: 3
    Last Post: 29th September 2009, 20:24
  3. QNetworkAccessManager vs QHttp
    By jiveaxe in forum Newbie
    Replies: 3
    Last Post: 17th February 2009, 14:07
  4. QHTTP::GET doesn't work as expected !
    By tuthmosis in forum Qt Programming
    Replies: 1
    Last Post: 27th July 2008, 15:45
  5. QHttp simple program doesn't work
    By johncharlesb in forum Qt Programming
    Replies: 0
    Last Post: 4th April 2008, 04:18

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.