How to connect via API?
Solved
General and Desktop
-
@Mikeeeeee Internet searching is your friend... maybe this example could help you.
-
delete
connect(apiQuery, &QNetworkAccessManager::finished, this, &MainWindow::testSlotFromQDebug);
then:
void MainWindow::on_testButton_clicked() { QNetworkRequest request; request.setUrl(QUrl("https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=5min&apikey=demo")); QNetworkReply* reply = apiQuery->get(request) connect(reply ,&QNetworkReply::finished,this,std::bind(&MainWindow::on_reply,this,reply )); } void MainWindow::on_reply(QNetworkReply* reply){ QJsonDocument jdoc = QJsonDocument::fromJson(reply->readAll()); // do something with the jdoc }
-
Qt says: qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
Make sure you have OpenSSL installed
I have api-key: 63YUZ8NP5SW1D302
How can I use the key? -
Hi,
@Mikeeeeee said in How to connect via API?:
I installed everything in MaintenanceTool. Do I need to download additional OpenSSL?
If you need to install OpenSSL, then how to connect it to Qt?What OS are you on ? My guess would be Windows.
-
-
What version of Qt are you using ?
-
-
Then try again with the latest version of the 1.0 series.
-
Still the same error or another one ?