Unable to hit connection/GET/POST request from Qt WebAssembly client to QHttpServer.
Unsolved
Qt for WebAssembly
-
Hello,
I have tried to run below mentioned code in desktop with QHttpServer module, it is working fine. When, I built it using Qt for WebAssembly, then run, the same QML page appears on the browser as the desktop but could not hit the QHttpServer module which is running in the same machine.
int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); test testclass; auto manager = QSharedPointer<RestAccessManager>::create("http://127.0.0.1", 51391); AddressBookModel model(manager); QQmlApplicationEngine engine; engine.rootContext()->setContextProperty("testclass", &testclass); engine.rootContext()->setContextProperty("addressBookModel", &model); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); QList<QObject*> root = engine.rootObjects(); if (root.isEmpty()) return -1; return app.exec(); }
Kindly suggest accordingly so that I could connect and GET/POST request to QHttpServer module.
Thanks,
Pradson