[Qt-interest] QT power switch
luis navarro
luis.navarro at jro.igp.gob.pe
Tue Nov 24 19:28:17 CET 2009
Thanks for your advices. I was trying this code without good results. Can
you give me a link where i can see some examples about how to handle the
cookie and post request?
void MainWindow::webPowerSwitch(){
QHttpRequestHeader header("POST", "/outlet?1=ON");
header.setValue("Host", "mypowerswitch");
header.setValue("Username","user");
header.setValue("password","xxxx");
header.setContentType("application/x-www-form-urlencoded");
http->setHost("mypowerswitch");
http->request(header, turnONString.toUtf8());
}
2009/11/24 Thiago Macieira <thiago at kde.org>
> Em Terça-feira 24. Novembro 2009, às 08.30.35, Thiago Macieira escreveu:
> > Em Terça-feira 24. Novembro 2009, às 01.31.02, luis navarro escreveu:
> > > That's really a problem because i need this application. So for this
> case
> > > what can we do?
> >
> > Wait for the authenticationRequired signal and fill in the data that it
> > requests.
> >
> > The other alternative is to fill in the form data and submit it. You can
> do
> > that via JavaScript or via QWebElement (4.6).
>
> A third alternative is to send a POST with the authentication data
> directly,
> as if you had clicked the Submit button in the form. That will probably
> send a
> cookie back to you, which you can use to send the next command.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Senior Product Manager - Nokia, Qt Development Frameworks
> PGP/GPG: 0x6EF45358; fingerprint:
> E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
--
Atte.
Luis Navarro Domínguez
luis.navarro at jro.igp.gob.pe
LISN Department
Jicamarca Radio Observatory
Geophysical Institute of Peru
Apartado 13-0207
Lima 13 - Peru
Telf: (51)-1-3172313
Fax: (51)-1-3172312
http://jro.igp.gob.pe/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091124/9ffdc1bb/attachment.html
More information about the Qt-interest-old
mailing list