Got it to work!
Just for future references to anyone else, someone pointed out to me the below codes:
QUrl command
("http://127.0.0.1/subdomain/letters");
command.setEncodedQuery(rawQuery);
std::cout << command.toEncoded().data();
QByteArray rawQuery("t=Someword&p=%01");
QUrl command("http://127.0.0.1/subdomain/letters");
command.setEncodedQuery(rawQuery);
std::cout << command.toEncoded().data();
To copy to clipboard, switch view to plain text mode
Result "http://127.0.0.1/subdomain/letters?t=Someword&p=%01"
Explanation from http://doc.qt.io/qt-4.8/qurl.html#setEncodedQuery
Sets the query string of the URL to query. The string is inserted as-is, and no further encoding is performed when calling toEncoded().
This function is useful if you need to pass a query string that does not fit into the key-value pattern, or that uses a different scheme for encoding special characters than what is suggested by QUrl.
Passing a value of QByteArray() to query (a null QByteArray) unsets the query completely. However, passing a value of QByteArray("") will set the query to an empty value, as if the original URL had a lone "?".
Bookmarks