Important: Please read the Qt Code of Conduct -

QNetworkReply->request().url().toString() does not encode space in url

  • GET url (1st) is like :


    2nd: QNetworkReply->request().url().toString(): encode "=" or "/", but not space

    https://requesturl&param=--directory ..%2Fwork%2Fnew_rand_tables condition

    3rd: If use QUrl::toPercentEncoding(reply->url()->toString()), this will encode space , but also encode %2, so it will be


    But this 3rd url is different from the original url (1st), i would not use 3rdUrl.replace("%25", "%").

    How to make 3rd url is the same as 1st url. (By the way, url is the key to retrieve handler).

    Thanks for comments.

  • request().url().toString(QUrl::FullyEncoded)

  • Updated, Solved by using


  • @Bonnie wow, thanks a lot. Also just find this function and prove your suggestion, thanks a lot.

Log in to reply