ich versuche, eine login Funktion zu schreiben, die mir entweder true oder false zurück gibt, abhängig von einem HTTP Response wert.
Das sind mein versuche:
Code: Alles auswählen
bool redaxo::login(QString uname, QString upassword)
{
...
connect(loginHTTP, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)),this, SLOT(readResponseHeader(const QHttpResponseHeader &)));
while(al < 3)
{
if(httpStatus == 302)
return true;
sleep(al);
al++;
}
return false;
}
void redaxo::readResponseHeader(const QHttpResponseHeader &responseHeader)
{
QString cookie = responseHeader.value("set-cookie");
cookie = cookie.section(";", 0, 0);
if(cookie != "")
rexCookie = cookie;
httpStatus = responseHeader.statusCode();
}Das Hauptproblem ist aber, dass im Slot readResponseHeader, der Variable httpStatus kein Wert zugewiesen werden kann.
vielen dank
RED