PDA

View Full Version : Http Post method help



ravirdv
27th September 2009, 13:15
i have this code to login to cyberoam server (for internet access) in python and its working fine, i want to do same with qt4



import urllib

urllib.urlopen("http://10.100.56.55:8090/corporate/servlet/CyberoamHTTPClient","mode=191&isAccessDenied=null&url=null&message=&username=YourUserName&password=YourPassword&saveinfo=saveinfo&login=Login")

i'm trying this using QHttp but getting Unknown error


void hRoam::on_pushButton_2_clicked()
{
QHttp http;
http.setHost("10.100.56.55:8090");
QByteArray *ba=new QByteArray("mode=191&isAccessDenied=null&url=null&message=&username=YourUserName&password=YourPassword&saveinfo=saveinfo&login=Login");
http.post("corporate/servlet/CyberoamHTTPClient",*ba);
qDebug()<<http.errorString();

}

please help