Posts Tagged ‘ rest ’
It’s very easy to call a rest service from qt, even with authentication, using QtNetwork/QNetworkAccessManager class http://doc.trolltech.com/4.5/qnetworkaccessmanager.html. Using the previous rest servlet sample. QNetworkAccessManager *manager = new QNetworkAccessManager(this); QObject::connect(manager, SIGNAL(finished(QNetworkReply *)), SLOT(slotRequestFinished(QNetworkReply *))); QNetworkRequest request; request.setUrl(QUrl("http://localhost:8080/restservlet/sample/tommy")); request.setRawHeader("Authorization", "Basic " + QByteArray(QString("%1:%2").arg("user").arg("asas").toAscii()).toBase64()); request.setHeader(QNetworkRequest::ContentTypeHeader, "text/xml"); QNetworkReply *reply = 0; reply = manager->get(request); QObject::connect(reply, SIGNAL(downloadProgress(qint64,qint64)), SLOT(slotProgress(qint64,qint64)))[ READ MORE ]
My first post is about to write a very simple authenticated rest server with : Spring (http://www.springsource.org/) Spring-security, formerly acegisecurity (http://static.springsource.org/spring-security/site/index.html) Maven, to manage the dependencies (http://maven.apache.org/) Restlet (http://www.restlet.org/) An easy way to try this sample rest servlet is with jetty (http://www.mortbay.org/jetty/) and the maven-jetty-plugin We can use curl to make a rest request (http://blogs.plexibus.com/2009/01/15/rest-esting-with-curl/)[ READ MORE ]
Get every new post delivered to your Inbox.