Reserved characters URL encoding



  • Good day, collagues!

    I want to encode part of my HTTP POST request, which contains XML. I try this:

    @post_data.append(QUrl(xml_array).toEncoded());@

    But ampersands hadn't been encoded. How can I automatically encode ampersands and other URL reserved characters?



  • Hmm, it seems that I should read documentation more carefully:

    @QByteArray toPercentEncoding ( const QByteArray & exclude = QByteArray(), const QByteArray & include = QByteArray(), char percent = '%' ) const@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.