T
T
Tesla4o2018-08-31 08:24:29
Qt
Tesla4o, 2018-08-31 08:24:29

Question on QUrl, why sends a request 4 times?

I send a simple get request to the server, and for some reason it is sent 4 times when the button is pressed 1 time.
here is a sample code:

QString request{"http://ipAddress:port/?action=user.signin&login=" +
        QString::fromStdString(this->_user) + "&pass=" + QString::fromStdString(this->_pwd)};

    QUrl url;// = QUrl::fromEncoded(request);

    if (!url.isValid())
        url.setUrl(request);

    QNetworkAccessManager *mng = new QNetworkAccessManager(Q_NULLPTR);

    connect(mng, SIGNAL(finished(QNetworkReply*)), SLOT(responceJson(QNetworkReply*)));
    QNetworkRequest req(url);
    mng->get(req);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question