QNetworkAccessManger get data
Solved
General and Desktop
-
Hello,i posted a thread before about this. But the thread just gone from my profile or its deleted but didt giving me a reason. So i posted it again.
How do i use QNetworkAccessManager to
GET
the data from a website?for example in python,we can use
import requests accounts = requests.get("http://pastebin.com/raw/eukYLq2y");
And we can get the data from the site
but how do i do it in Qt C++ and make it in QString?
I need it become QString becasue i wanna do this:#include <QNetworkAccessManager> QString input = ui->input->text(); QString webdata = /*QString of website data*/; if(accounts.contains(input)) { //Do code } else { ui->error->setText("Wrong input entered"); }
Please help,and please dont delete the thread.Thx.
-
@ELEMENTICY You get QByteArray and can create a QString out of it by simply usinig https://doc.qt.io/qt-5/qstring.html#QString-8
-
@ELEMENTICY Have you checked the Qt network examples, the simple HTTP client for instance?