Change QHttp:: state() from unconnected to connected
-
I try to write program which handle web service using QHttp :: Post().
When i click on button ,it will sent post request.
but the QHttp :: state() =Unconnected.
[Code :]void MainWindow::LogIn()
{
ui->btnLogin->setEnabled(false);
QUrl url;
url.setPath("path of API");
QByteArray data("username=");
data.append(ui->txtUserName->text());
data.append("&password=");
data.append(ui->txtPassword->text());
http->setHost("Website.com");
int result= http->post(url.toString(),data);//note result =2
http->state();//note state = Unconnected
}
how can change state of http to connect ???Thank you for your help.
-
Thank blex and Antonio very much, I try to connect with done() and it's connect.