Hi,
The following code doesn't work...
Before calling this method, the http class worked good by initially calling sethost method and then several get methods.
But then I need to send a lot of variables, so the POST method is necessary.
I tested a POST html form to valid my PHP script send.php. Everything is ok.
Also, the SLOT requestFinished is called and no errors are reported...
Any idea? Or a functional POST method example?
Thanks
Oscar
void MyExport
::sendHealthCase(QString recipient
) { QString person
= "type=healthcase";
person += "&recipient=" + recipient;
person += "&from=" + email;
Patient patient = Patient::get(patientId);
person += "&table=person";
person
+= "&civilStatus=" + QString::number(patient.
civilStatus);
person += "&surname=" + patient.surname;
connect(http, SIGNAL(requestFinished(int, bool)),
this, SLOT(healthCaseFinished(int, bool)));
http
->post
( QString("/software/send.php"), person.
toUtf8());
}
void MyExport::sendHealthCase(QString recipient) {
QString person = "type=healthcase";
person += "&recipient=" + recipient;
person += "&from=" + email;
Patient patient = Patient::get(patientId);
person += "&table=person";
person += "&civilStatus=" + QString::number(patient.civilStatus);
person += "&surname=" + patient.surname;
connect(http, SIGNAL(requestFinished(int, bool)),
this, SLOT(healthCaseFinished(int, bool)));
http->post( QString("/software/send.php"), person.toUtf8());
}
To copy to clipboard, switch view to plain text mode
Bookmarks