QT: I was wondering if there is a way to create a QUrl or another URL class object from string without encoding the final URL. For example, here is a snippet of my code:
QString GetJsonStringFromURL(QString url) //url == "192.168.0.111/controller?POSITION|03|100"
{
QEventLoop eventLoop;
QNetworkAccessManager mgr;
QObject::connect(&mgr, SIGNAL(finished(QNetworkReply*)), &eventLoop, SLOT(quit()));
QNetworkRequest req( QUrl::fromUserInput(url) ) ;
QNetworkReply *reply = mgr.get(req);
eventLoop.exec(); //wait till reply finished
QString strReply = reply->readAll();
return strReply;
}
This code accesses a local area network controller requesting it's json with a get method, while passing a parameter in the url. The url i'm passing gets percent encoded to:
"192.168.0.111/controller?POSITION%7C03%7C100"
which i am trying to avoid. The server i'm trying to access is a custom piece of hardware with firmware written in C which doesn't incorporate percent decoding. I would like to avoid doing maintenance on the server side. I have tried going through QUrl class reference but none of the available methods provided the wanted result.