Hello.
I got a small problem with a post method using QNetworkAccessManager. After sending the data to http-server, I would like to read a response from the server. And here is the problem. After the first response from the server. I can't send any data to the server anymore. Here is the code:
Code:
{ this->reply = this->objectQNetworkAccessManager->post(this->objectQNetworkRequest, data); connect(this->reply, SIGNAL(finished()), this, SLOT(readData())); } void Client::readData() { if(this->reply->error() == QNetworkReply::NoError) { qDebug() << "data send"; qDebug() << this->networkReply->readAll(); } else { qDebug() << "error"; } this->reply->deleteLater(); }
If I don't try to read any data from QNetworkReply everything works fine...
What's wrong with the code above?
Thank you for answers beforehand.
Added after 4 minutes:
Sorry for disturbing... I found the answer.
connect(this->reply, SIGNAL(readChannelFinished()),
this->reply, SLOT(deleteLater()));