I have just released the first version of QHttpEngine, which aims to fill the gap that you've described. The goal of the project is to provide an extremely simple set of classes that provide an HTTP server that integrates with Qt.
For example, to serve static files from resources in your application, all you would need to do is:
QFilesystemHandler handler(":/www");
QHttpServer server(&handler);
server.listen(QHostAddress::LocalHost, 8000);
You can also create a class derived from QObject
that expose its slots as endpoints in an HTTP API. For example:
class ApiHandler : public QObjectHandler
{
Q_OBJECT
private slots:
QVariantMap doSomething(const QVariantMap ¶ms) {
// do something with the parameters and return a response
}
};
Users can then send a POST request to /doSomething
with the parameters encoded as JSON and receive the response that the slot generates.
The entire library is fully documented and comes with a rather exhaustive test suite. It is cross-platform and is officially tested and supported on Linux, Windows, and Mac OS X. There is at least one major open-source application using QHttpEngine, NitroShare.